lua-users home
lua-l archive

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




2011/1/29 Enrico Colombini <erix@erix.it>
On 28/01/2011 17.20, Paul Hudson wrote:
Can we  have computed go to? http://en.wikipedia.org/wiki/Goto#Computed_GOTO

(I am joking, but it would actually fit quite well with the current
proposal.

      break (n) :label1: :label2:

anyone?)

Well, if break accepts a string... :-)

 local somewhere = getRandomDestination()
 break(somewhere)

--
 Enrico

maybe we can made break a function: if it don't accept arguments, it breaks current layer, but it can accept a number to break out nth layer of for/while/repeat loop.