lua-users home
lua-l archive

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

On Tue, Jul 10, 2007 at 08:41:47PM +0200, PA wrote:
> On Jul 10, 2007, at 20:37, Lavergne Thomas wrote:
> >  value, delta = object[idx]
> >but it's impossible.
> Well... if you don't mind a bit of overhead, what about:
> local value, delta = unpack( object[ idx ] )
> Assuming object[ idx ] returns a table with { value, delta }
> Not sure if the cure is worse than the disease though...

Yes, but this is very unelegant and it have two drawback, I need to
change all the existing code, and this is called a lot of time so it
result in a lot of quickly destroyed small tables, so gc become crazy...


Thomas Lavergne                       "Le vrai rêveur est celui qui rêve
                                       de l'impossible."  (Elsa Triolet)