lua-users home
lua-l archive

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


On Wednesday, February 22, 2023 at 12:53:32 PM CST, bil til <biltil52@gmail.com> wrote:

> In fact, I also was disturbed a bit already that "print 'hallo'"
> works, but not "print 4".

FWIW, I suspect Lua not needing parentheses if a function's single argument is a string or table was a special request from an early client.  That said, it makes a certain amount of sense. { ... } , "...", and [[ ... ]] already act as delimiters, so parentheses feel almost redundant.

Numbers and keyword constants, on the other hand, don't have an unambiguous begin or end mark. (Having written a JSON parser in Java recently, such a lack makes parsing them just a little harder.)  Also, as the rest of Bil's post and some follow-ups point out, one could run into ambiguity and surprising behavior.

So, if Lua were a democracy, I'd vote no. But it's really up to Roberto Ierusalimschy, Waldemar Celes, and Luiz Henrique de Figueiredo. (Unless someone really, really, really wants to fork Lua. What's the name of Earth's second moon again?)


Frank Mitchell