lua-users home
lua-l archive

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


On Sun, Oct 03, 2010 at 10:24:10AM +0200, Petr Štetiar wrote:
> Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> [2010-10-02 18:20:47]:
> 
> > >   cat <<EOS | luac -o data.luac -
> > >   do
> > >    return { "one", "two", "three" }
> > >   end
> > 
> > No need to wrap the return inside a do-end block.
> 
> I think, that just the table is enough.

Like this?

cat <<EOS | luac -o data.luac -
{ "one", "two", "three" }
EOS


Doesn't work. The table is an expression and lua expects a statement.
The 'return' is necessary to make the line a statement and to return the data.

-Gyepi