[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: metatables for strings?
- From: Hisham <h@...>
- Date: Wed, 6 May 2015 11:46:49 -0300
On 3 May 2015 at 13:39, Dirk Laurie <firstname.lastname@example.org> wrote:
> 2015-05-03 18:33 GMT+02:00 Nagaev Boris <email@example.com>:
>> PS. I still like syntax "hello":sub(1, 4)
> Didn't somebody make a patch to allow that?
I always wondered: is there a reason why this syntax is not supported?
(Other than vacuously-true answers such as "it wasn't implemented that
way" or "because the grammar disallows it")
In other words, does disallowing it prevent a bad grammar ambiguity,
or something like that? Having to write those parentheses every time I
use :format() is really annoying, especially knowing that the language
even has a special case for dropping parentheses on func"arg".