lua-users home
lua-l archive

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


Paul Bleisch <bleisch@chromatic.com> writes:

> lua-l
> 
> I was messing around trying to use lua as a model definition
> system and came across a small problem I think.  For some reason:
> 
> Foo = {
>   Name="Foo",
>   {0,1,2,3,4}, -- <-- here see note below
>   {1,2,3,4},
>   {2,3,4},
>   {3,4}
> };
Is it acceptable for you, to write:

 Foo = {
   {0,1,2,3,4}, 
   {1,2,3,4},
   {2,3,4},
   {3,4};
   Name="Foo"
 };

which is equivalent to 

Foo[1]={0,1,2,3,4}
Foo[2]={1,2,3,4}
Foo[3]={2,3,4}
Foo[4]={3,4}
Foo[Name]="Foo"

Note the semicolon between the list-part and the hashtable-part. The order
of these two parts is significant.

Greetings
Stephan

--------------------------------------------------------------------------
 Stephan Herrmann
 ----------------
 Technical University Berlin
 Software Engineering Research Group
 http://swt.cs.tu-berlin.de/~stephan
 phone: ++49 30 314 73174         
--------------------------------------------------------------------------