[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why table.pack() does not use __len?
- From: Dirk Laurie <dirk.laurie@...>
- Date: Tue, 26 Jul 2016 10:52:46 +0200
2016-07-26 10:45 GMT+02:00 Peter Melnichenko <mpeterval@gmail.com>:
> On Tue, Jul 26, 2016 at 6:34 AM, Rodrigo Azevedo <rodrigoams@gmail.com> wrote:
>> Let's try:
>>
>> 0) define __something as "reserved" words.
>>
>> 1) Define the table as its own "metatable" by default, namely, search for
>> __something when appropriate and fallback to the one defined by
>> setmetatable() (standard behavior) (why not?)
>
> With this change it's no longer possible to use tables with arbitrary
> string keys.
> Every `t[k] = v` assignment will soon cause an error if `k` happens to
> be one of metamethod names.
Readers of this thread may like to know that recent posts in the thread
'Quest: real world "Lua array with holes" usage' contain related if not
actually overlapping issues.