[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Tuple
- From: David Manura <dm.lua@...>
- Date: Fri, 17 Aug 2007 03:03:51 +0000 (UTC)
Luis Carvalho <carvalho <at> dam.brown.edu> writes:
> I decided to put together a simple tuple implementation based on previous
> discussions in the list
PiL, 2nd ed., 27.3, implements a more minimal form of that same idea. (PiL also
omits the n <= LUA_MINSTACK check, which I think is ok.)
Your example does illustrate a case where it would be useful for different
functions to have different metatables. #t should have different behaviors
depending on whether the closure t represents a tuple or something else. An
alternative is to wrap the closure in a table or, maybe, multiplex the function
metatable.