lua-users home
lua-l archive

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


On Fri, 28 Jan 2011, Paul Hudson wrote:
>
> Can we  have computed go to? http://en.wikipedia.org/wiki/Goto#Computed_GOTO

Remember lambda is the ultimate goto. In Lua, instead of `goto x`, we
write `return x()`. Computed goto can be written `return t[i]()`.

Tony.
-- 
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/
HUMBER THAMES DOVER WIGHT PORTLAND: NORTH BACKING WEST OR NORTHWEST, 5 TO 7,
DECREASING 4 OR 5, OCCASIONALLY 6 LATER IN HUMBER AND THAMES. MODERATE OR
ROUGH. RAIN THEN FAIR. GOOD.