lua-users home
lua-l archive

Re: Table assignments in varargs function call

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


--- Peter Loveday <peter@eyeonline.com> wrote:
> I am trying to achieve syntax like:
> 
> function xyzzy(...)
> ...
> end
> 
> a = xyzzy(A = 1, B = 2)
> 
> Is there any way to achieve this? I currently have:
> 
> function xyzzy(tbl)
> ...
> end
> 
> a = xyzzy({ A = 1, B = 2})
You can just say:
a = xyzzy{ A = 1, B = 2 }
Cheers,
Eric
__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just 8ドル.95/month.
http://geocities.yahoo.com/ps/info1

AltStyle によって変換されたページ (->オリジナル) /