lua-users home
lua-l archive

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


--- Virgil Smith <virgil@nomadics.com> wrote:
> OK, I'll bite...
> I don't remember it off the top of my head (and can't take the
> time to look anything up at the moment, but don't want to forget
> this), however...
> 
> Isn't there a simply way in Lua 5.0 to declare a function that
> takes all of its arguments in a table? Also, isn't there a way to
> expand a table back into a list of arguments?

function foo(...)
 print(unpack(arg))
end

foo(1,2,3,"a","b",{"c"})




__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com