lua-users home
lua-l archive

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

On Mar 1, 2010, at 3:01 AM, Juris Kalnins wrote:

> I'd like to ask if you could consider making it possible to have 0..MAXSOMETHING
> Lua values associated with userdata (specified at the creation time),
> insetad of the fixed 1.
> It wouldn't complicate core much, but could really help in the cases where one
> has to associate more than one value with userdata.

This sounds like a proposal to give userdata a variable number of "upvalues" rather than a single environment.

While the philosophical change is consistent with the change to closures, how would you distinguish between upvalues associated with the userdata itself, and upvalues associated with the closure invoked to access the userdata?

I'm in favor of such a change if it can make the model simpler and more consistent, but right now it sounds like it creates two analogous systems for little added benefit.