lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 3 May 2015 at 13:39, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 2015-05-03 18:33 GMT+02:00 Nagaev Boris <bnagaev@gmail.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".

-- Hisham