[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: #s semantics (was Re: Lua 5.1-work6 cumulative PATCH #1)
- From: Rici Lake <lua@...>
- Date: Wed, 3 Aug 2005 17:53:51 -0500
On 3-Aug-05, at 5:22 PM, Mark Hamburg wrote:
Not that anyone probably wants to change 5.1 at this point, but maybe
answer to these issues is a way to override OP_SELF to better work with
basic types. That way, one could define default implementations for
That seems counter to the behaviour of metamethods on other operators.
Or would you also suggest that a[x] be changed to rawget(a, x) and
metauses rewritten as a:get(x)? And, by the same token, a:plus(b) to
get the metamethodical '+'? I think the syntactic beauty of metamethods
is precisely that they are easy to write.
It's not clear to me how OP_SELF could work with the table basic type,
in any event, unless it were redefined to only look in the metatable.
Otherwise, it would limit the keys you could place in a table (viz.