[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why table.pack() does not use __len?
- From: Peter Melnichenko <mpeterval@...>
- Date: Tue, 26 Jul 2016 11:45:59 +0300
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.
-- Peter