lua-users home
lua-l archive

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


> I know there are hooks on values in general, but we want to avoid
> checking to see if a given value is one we're interested in if at all
> possible.

If you use the __newindex metamethod, you only have to check names when
the program assigns to an undefined variable. Usually this is rare
enough to make any impact on overall program performance. (Of course,
you must keep the "interesting variable" undefined and store its real
value somewhere else.)

-- Roberto