[slang-users] Re: goto statement in slang

John E. Davis davis at space.mit.edu
Wed Sep 17 13:31:15 UTC 2008


Jörg Sommer <joerg at alea.gnuu.de> wrote:
> As we all know goto is evil, I expect you never will implement it. But

I used to think it was evil when I started writing code.  I was very
proud of the fact that my first version of `most` did not use "goto".
For the second and third rewrites of `most`, I replaced the crud that
was necessary in the various looping statements to avoid the use of
"goto" with "goto" and the result was much cleaner and understandable
code.  Now I use "goto" when I feel that its use adds clarity to the
code, and I feel that those who oppose its use are naive.

With that said, I have no intentions to add it to slang and would
rather add richer control statements, such as the "then" clause that
was added to the looping statements of slang-2.1.

> what about break and continue with an optional level as in shell.

I have thought about that for slang-2.2, but I will make no promises
about it yet.

Thanks,
--John


More information about the slang-users-l mailing list