lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


	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.


	bfn
	lyndon

> 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.
> 
> --Adam