[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: getn, setn proposal
- From: Mark Hamburg <mhamburg@...>
- Date: Tue, 21 Feb 2006 09:56:02 -0800
It might be a good idea to have a standard module implementing the old
getn/setn semantics -- e.g., ntable.getn, ntable.setn.
Then a project trying to migrate off of these, can build Lua without the
compatibility flag and instead load the ntable module and either redefine
the contents of table or update code to go through ntable instead.
What this doesn't address is the use of arg.n in dealing with old-style
varargs. That could, however, be in part dealt with by defining ntable.pack
which would set the n value appropriately. ntable.unpack similarly would
obey the value.
(I'd write this myself and post it by grabbing existing code from various
places such as the compatibility code in the distribution, but I've got a
schedule this week that leaves me already asking when I will actually get to
write code. Knowing how this list works, it could be done before I get a
chance to write anything.)