lua-users home
lua-l archive

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


On Wed, Sep 16, 2009 at 6:41 PM, Eduardo Ochs <eduardoochs@gmail.com> wrote:
> When functions have a metatable and when that metatable has a field
> "__colon", then the expression
>
>  f:method
>
> without an argument list, of course, would just return the result of:
>
>  getmetatable(f).__colon(f, "method")

But this would be a runtime thing, not a compile-time transformation.
So there would have to be some bytecode representation of 'f:method'
(without parens) whereas 'f:method()' has been simply transformed into
a table lookup and a function call.

Man, I can see many opportunities for confusion!

steve d.