lua-users home
lua-l archive

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


On Thu, Sep 16, 2010 at 10:50 AM, steve donovan
<steve.j.donovan@gmail.com> wrote:
> On Thu, Sep 16, 2010 at 9:47 AM, Benoit Germain <bgermain@ubisoft.fr> wrote:
>> Would this be easily understood?
>> a,b = choose(condition,(1,2),(3,4))
>
> Well, only if you know Python ;)
>
> There's no obvious way to write that in Lua...

a,b = unpack(choose(condition,{1,2},{3,4}))

Yes, not exactly obvious, but still ... :)

Best,
Bogdan