lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Jul 29, 2013, at 11:51 AM, Jay Carlson <nop@nop.com> wrote:

> Actually, I fixed the overly tight binding: my expansion looks up methods by name at invocation rather than at construction. I think the primary goal is coming up with a reasonable syntax for the expression; this is separable from trying to optimize out the table lookup.

I've written bind implementations both ways. Whether one cares about delayed method lookup depends on whether you redefine methods on the fly. Whether you should have bind do delayed lookup depends on how closely you want to have o:m mirror o.m.

On the equality testing front, I can see wanting this but I could also see the next step being a desire to have a single value in the universe for o:m so that it could be used as a table key and that would raise the cost of creating such bindings. As a point of reference, these are essentially C# delegates and those, I believe, get constructed anew each time (but I could be wrong on that).

Mark