[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: goto
- From: "Samson, Lyndon (GEIS)" <Lyndon.Samson@...>
- Date: Tue, 20 Jul 1999 10:38:52 +0100
You are probably best to use goto to get out of an error condition
when in deeply nested code, tagmethods can work
like exceptions in this case and jump you out.
It's unfortunate that 'return' has to be the last statement in a
function, it would be quite useful in these circumstances if it
could be used anywhere.
> I don't think I *really* need my microwave oven, or my automobile,
> but I find them convenient tools to have around at certain times.
> "Djikstra considered harmful"
> I don't think Lua *really* needs 'repeat' and 'if'. After all,
> 'while' should be sufficient for doing everything these other
> keywords do. However, I sometimes find it convenient to use one
> or the other, depending on what the task at hand is.
> There are actually a small handful of algorithms where the code
> actually does look cleaner with a 'goto' than it would with
> other constructs. Most languages have some kind of construct
> for unconditional, non-returning branches.