lua-users home
lua-l archive

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


On Mon, Dec 22, 1997 at 08:27:14AM -0200, Luiz Henrique de Figueiredo wrote:
> >> a_table = { [1]="test" ; ["1"] = "test string" };
> >
> >Why does the syntax enforce numbered items before string items though? It
> >seems with the syntax you present above, there would be no confusion, even
> >when alternating numbered and string entries, for example:
> >
> >a_table = { [1]   = "test number 1",
> >            ["1"] = "test string 1",
> >            [2]   = "test number 2",
> >            ["2"] = "test string 2" };
> 
> sorry, i wasn't clear.
> with the general syntax, there are no restritions and you can write
> exactly the form above.
> inside [...] you ca put any *expressions* such as:
> 
> a={[1+2*4]="a", [sin(34)]=12, [f(x,y,z)]=45}
> --lhf

ahh, thanks, that sounds great. Although I'll still be looking forward to
being able to put a "record" part before a "list" part as described in
another followup.

-- 
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@chat.net