lua-users home
lua-l archive

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


Cant you write your own metaparser for this to generate Lua code on the fly with the respective goto statements?

To cover all these skin-deep things for different taste a good idea for the next Lua goal might be meta programming.

As simple as allowing source maps to ease error searching (error messages printout original line numbers as code).

Or a bit bigger incooperate some ideas from metalua into the main stream while recoding the whole thing respecting the Lua-not-invented-here-syndrome.

Do it yourself like you want it to be would be a very lua-ish approach.

On Mon, Nov 24, 2014 at 7:39 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
Optional integer constant after "break" specifies number of enclosing
loops to break. `break 1` means the same as `break` without a number.

Example: find an item in a table of lists, with shortcut exit from a list.

for k,a in pairs(t) do
    for n,b in ipairs(a) do
       if futile(b) then break end
       if found(b) then row,col = k,n; break 2; end
   end
end