lua-users home
lua-l archive

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


On Thu, Jun 18, 2015 at 11:15 AM, Philippe Lhoste <PhiLho@gmx.net> wrote:
> Well, I don't use it systematically, but allows writing some nice DSLs, so
> it has its uses, beyond saving typing / reducing noise.

Certainly LPeg would be much more noisy if we didn't have this little
bit of sugar.  Personally, when I see 'something string-literal' and
'something table-ctor' I always think 'function call'.

Moonscript even goes to some trouble to preserve this idiom, leading
to unfortunate horizontal whitespace dependency: 'F"boo"..s' is NOT
the same thing as 'F "boo"..s' due to the low precedence of the call
operator.

As for named parameters: we have the F{name='foo'} idiom, which of
course does involve creating a table.  But most complicated functions
that need named parameters can probably afford that cost.