Re: wikipedia draft
- Posted by katsmeow Jan 13, 2021
- 1502 views
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 ::orangeBut of course we could find a way to do that differently now.
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