lua-users home
lua-l archive

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


In message 
<CAPsVyB9pBJ8EMxFCiMfQrCG-dwejco2R3ojmZX8Vka-Co9VD4w@mail.gmail.com> 
you wrote:

> >      for _,record in ipairs(list) do
> >        local name,adr,email,job in record
> >        display(name,adr,email,job)
> >      end
> >
> 
> So, what about the semantics become a exprlist?
> exprlist ::= expr { ',' expr } |
>                  namelist 'in' expr
> 
> this allows some syntax:
> local a, b, c = d, e, f in t
> dump(a, b, c in t)
> local t = {a, b, c in t}

Aha, terser still. I like the idea of being able to write

        for _,record in ipairs(list) do
           display(name,adr,email,job in record)
        end

If you produce a patch to do this please send me a copy :).

-- 
Gavin Wraith (gavin@wra1th.plus.com)
Home page: http://www.wra1th.plus.com/