[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why table.pack() does not use __len?
- From: steve donovan <steve.j.donovan@...>
- Date: Tue, 26 Jul 2016 10:53:14 +0200
On Tue, Jul 26, 2016 at 10:45 AM, Peter Melnichenko <mpeterval@gmail.com> wrote:
> Every `t[k] = v` assignment will soon cause an error if `k` happens to
> be one of metamethod names.
It's generally a bother writing wrappers around tables, because as
soon as you introduce some convenient helper methods, they will
collide with some arbitrary key that the user wants to store. pl.Map
suffers from this problem, which is why pl.Set has no methods. There
are fixes but they are expensive.
But, back to topic: currently, the rules are simple. Adding arbitrary
extra rules makes it harder to explain and use the language.