Re: When it comes to GOTOs...

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

>what i'm saying is, there might be some hurdles necessary to overcome in
>order to achieve goto type statments--not only that, but I seem to remember
>having line numbers fell in somewhere along "horrible, terrible"--perhaps a
>"tag" as in html would be more appropriate.


Goto is hack.
Its ugly. It is a shame we have a need for them at times. Reconcider your
algorithm.
However structured goto's might give us a bit more freedom to structure an
algorithm more in the way we see it, then how it fits the interpreter.

And no, interpreters love gotos. Internally Euphoria makes it one big-goto.
All built-in expressors, statements and routines are replaced with a 32-bit
memory pointer of the machine code to handle that action, followed up by
pointers pointing to the variables or values that need to be used. And
eventually, a pointer where to store the variable. And next comes the
pointer of the next command, which is 'JMP' (jumped) to by the last command.
In other words, there's one big stack, and Ex.exe is jumping around on it.
Goto's are pretty natural internally thus, however they are not the tools to
use in algorithms. That would be bad style. A hack.

Ralf

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

Search



Quick Links

User menu

Not signed in.

Misc Menu