[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Protocol Specification in Lua
- From: Petr Štetiar <ynezz@...>
- Date: Mon, 4 Oct 2010 11:53:24 +0200
Gyepi SAM <self-lua@gyepi.com> [2010-10-03 18:54:43]:
> On Sun, Oct 03, 2010 at 10:24:10AM +0200, Petr Štetiar wrote:
> >
> > 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.
Sorry, overlooked it. I've meant table assigned to variable, somethin like
this:
ynezz@wizard:~$ cat test.lua
t = { "one", "two" }
ynezz@wizard:~$ luac -l test.lua
main <test.lua:0,0> (6 instructions, 24 bytes at 0x8060d10)
0+ params, 3 slots, 0 upvalues, 0 locals, 3 constants, 0 functions
1 [1] NEWTABLE 0 2 0
2 [1] LOADK 1 -2 ; "one"
3 [1] LOADK 2 -3 ; "two"
4 [1] SETLIST 0 2 1 ; 1
5 [1] SETGLOBAL 0 -1 ; t
6 [1] RETURN 0 1
-- ynezz
- References:
- Protocol Specification in Lua, John Passaniti
- Re: Protocol Specification in Lua, Kevin Vermeer
- Re: Protocol Specification in Lua, John Passaniti
- Re: Protocol Specification in Lua, Petr Štetiar
- Re: Protocol Specification in Lua, Sean Conner
- Re: Protocol Specification in Lua, Ico
- Re: Protocol Specification in Lua, Gyepi SAM
- Re: Protocol Specification in Lua, Luiz Henrique de Figueiredo
- Re: Protocol Specification in Lua, Petr Štetiar
- Re: Protocol Specification in Lua, Gyepi SAM