by garply · 17y ago · 0 comments
Perl also provides 'last LABEL', which is handy (lets you break out of any level of nesting).
I guess in a language like C where you can have neither and function calls are slow so the 'return' escape continuation is also unusable there is a reason to use goto for this.
(Loop exits, exceptions, returns from functions, etc. are all special cases of continuations.)
This is an improvement over something like Perl's "last LABEL" statement, because you can pass the continuation around and exit the loop from anywhere you desire.
E.g. the SQL script I've been working on today has a number of gotos in it.