[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Metatables for functions
- From: Mark Hamburg <mark@...>
- Date: Tue, 24 Mar 2009 16:59:26 -0700
Is there any reason not to support metatables for functions? Obviously
the __call metamethod is superfluous for functions, but I could
imagine uses for other cases. In particular, one could then consider
using operators to combine functions. Since these cases would
currently just end in an error or in the generic metatable for
functions and given that functions aren't particularly tiny objects to
begin with, the cost seems like it ought to be small.
I'll have to think about whether this would be truly useful or just
interesting, but I was wondering whether there is a reason why it
would be a bad idea.