[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: #s semantics (was Re: Lua 5.1-work6 cumulative PATCH #1)
- From: Mark Hamburg <mhamburg@...>
- Date: Wed, 03 Aug 2005 16:31:54 -0700
I don't have clear answers for this. You are correct that this would have
implications for t[ x ] if carried through to its logical conclusion.
But I find it odd to allow length to get redefined for tables and not for
strings and there seemed to be a strong consensus for not redefining it for
strings. So, I was looking for a way to make it consistent.
The OP_SELF stuff had to do with making sure that one could send messages to
basic types in some way.
on 8/3/05 3:53 PM, Rici Lake at email@example.com wrote:
> 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.