Re: Storing Variable Properties
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Storing Variable Properties
- From: Roberto Ierusalimschy <roberto@...>
- Date: 2004年1月13日 09:18:44 -0200
> 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