[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: New metamethod for method lookup
- From: Mark Hamburg <mark@...>
- Date: Sun, 15 Nov 2009 18:16:00 -0800
On Nov 15, 2009, at 6:04 PM, Jerome Vuarand wrote:
> Not only an addition, but a mere syntax addition. The code behind the
> new syntax can already be written with current Lua, the added value is
> nothing compared to for example tail calls or userdata environments,
> which are real features.
It is more than a syntax addition. The code cannot be written with current Lua because right now Lua provides no way to guarantee that a method is only invoked on the object with which it is associated. (Or at least no efficient way. One could have the method lookup return a closure that then ignored the first parameter passed to the call, but that would be immensely more expensive.)
Mark