lua-users home
lua-l archive

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



On Wed, Jun 5, 2019 at 3:16 PM Philippe Verdy <verdy_p@wanadoo.fr> wrote:
As well, Lua does not support "f(x=0)" because of currification, and then chosed to sacrifice the possibility of performing assignments in the middle of expressions.

That's not why Lua doesn't support it. Lua doesn't support it because assignment is intentionally a statement, not an _expression_, and function parameters must be expressions. This was a design decision, not a parser simplification -- a way to prevent the "if (x = 0) { ... }" issue that affects C-like languages.

/s/ Adam