[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: continue continued, with break N
- From: Joshua Jensen <josh.jjensen@...>
- Date: Fri, 19 Nov 2010 07:30:34 -0700
----- Original Message -----
From: Axel Kittenberger
Date: 11/19/2010 2:00 AM
FWIW, both proposals are interesting, but I would be happy with just a
simple 'continue' keyword that works according to the already existing
patch for Lua 5.1.
I've another idea how to capture full loop functionality, in a way
I've not yet seen in another language.
1) continue as new keyword - better just get over with it, than to
overload existing keywords with new functions that are contrary to
their everyday meaning - like break as continue..
2) let continue take an optional argument to how often call the
iterator for for loops.
continue -- like in C, do next iteration
continue 1 -- synonymous to continue - call iterator once
continue 0 -- goes to start of loop calling the iterator 0 times - "redo"
continue 2(or more) -- calls the iterator twice, skiping one
continue -1 -- error! cannot reverse iterate (with n..m..k loops this
might theoretically work, but not with genericf for loops)
thinking about e.g. argument parsing, this continue X would be a dream!