lua-users home
lua-l archive

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

RTFM 2.5.6 (in 5.0 "FM") Table Constructors.

-----Original Message-----
[]On Behalf Of Marc Nijdam
Sent: Monday, October 13, 2003 12:24 PM
Subject: assignment syntax in tables


according to the reference manual multi-assignment is possible, eg,

x, y = 1, 2;

Does this apply within tables as well? eg,

table = {
	x, y = 1, 2;

Running this through lua and printing the table gives me

2 = 2
y = 1

which is not what I expected... Am I misunderstanding something or is the 
only way to do this to declare the table

table = {};

and then place into it

table.x, table.y = 1, 2;

which does do the right thing, but is not what I was trying to do