lua-users home
lua-l archive

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



15.9.2004 kello 11:22, Philippe Fremy kirjoitti:

 First, I would not make a distinction between tuple and lists. Both
represents the same thing.

To me:

- Lua tables are table by reference
- Tuples are table by value (no such thing currently in Lua)

As far as I know, it is not possible to know from a function return value how many values where just returned. You can pack them and unpack them but
it is not possible to know in advance how many of them are there. In my
opinion, the return value of a function in lua is a kind of hidden list.

You're right. However, this seems to be changing with the exploratory '...' operator in Lua 5.1. Sort of tuple, I guess.

You can do even now:

	local tbl= { function(whatever) }
	print table.getn(tbl)

-ak