Quoting shortcutter / googlemail.com, on Sat, May 20, 2006 at 01:24:44AM +0900:
> I see this differently: experience has shown that GOTO in most cases
> leads to bad code. It's also formally proven that it's not needed,
> i.e. the same semantic can be achieved without it (but using if -
> else, loop constructs etc.).  Since these other constructs of course

It is also formally proven that just a conditional and a goto is
sufficient to implement loops, which I got to "appreciate" when writing
robot controllers in a variant of basic once. Bad memories.

I think goto would be difficult to implement in a dynamic language like
ruby, because of issues of scope and context, its not just where you are
in the code thats important, but how you got there.

If you want a goto, ruby has a number of options that might fit the
need: cast statements, call/cc is like goto on steroids with a laser
blaster, return/break/next, raising an exception, and catch and throw
all jump the point of execution from one place to another.

I use goto frequently in C for structured handling of error conditions.
This use is unnecessary in ruby, or even C++, because they have
exceptions and automatic stack cleanup builtin to the language.

Cheers,
Sam