Re: wikipedia draft

new topic     » goto parent     » topic index » view thread      » older message » newer message
petelomax said...
katsmeow said...

However, and you are in a better position than me to test this, this feature prohibits the ability to goto the value of a variable.

words = {"apple","tree","cow"} 
goto words[1] 
:tree -- code for trees 
:apple -- code for apples 

Oh my, I wasn't planning on anything like that.

Why on earth would anyone in their right mind ever want anything remotely like that, he asks, hopefully rhetorically.

In the olden daze, and here i mean the early 1980's (like 1979), it was a pretty elegant way to do a case statement. In the example, i picked a value from the predetermined list of words, as if i was restricting the range of words, but back then it was common to play with the machine code mechanism behind the scenes, leading to such situations (updated with modern Eu/Phix syntax) as

goto {"tree","orange"} 
:tree 
::orange -- would land here 
:color 
::orange  
But of course we could find a way to do that differently now.

petelomax said...
katsmeow said...

doesn't mean i'd prohibit back jumps.

I said recommend, not prohibit.

Yes, sorry, let me rephrase : i would not prohibit whichever one i didn't recommend.

Kat

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu