[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Functions with individual metatables
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 25 May 2009 19:27:21 +0200
On Mon, May 25, 2009 at 7:18 PM, Petite Abeille <petite_abeille@mac.com> wrote:
> Perhaps I'm totally missing the point, but... what's the difference between
> a function with a metatable and a table with a call metamethod?
Well, indeed they are both callable. But then one has to be careful to
be consistent, and everything ends up being functors. I'll do a few
microbenchmarks to see what the cost implications of functors versus
functions would be, since measurement is better than opinion.
A short answer to your rhetorical question would be: the first is
primarily meant to be called, and the second is primarily intended for
indexing.
steve d.