lua-users home
lua-l archive

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


On Tue, Jul 23, 2019 at 12:56 PM Viacheslav Usov <via.usov@gmail.com> wrote:
On Tue, Jul 23, 2019 at 7:19 PM Coda Highland <chighland@gmail.com> wrote:

> And Lua doesn't have comprehensions OR lambdas.

As stated already, Python-related reasons are irrelevant.

It's relevant by virtue of the contrast between the two languages. If Lua HAD lambdas (or, to a lesser extent, comprehensions), then assignment expressions would make more sense.

Python syntax is built in such a way that assignment expressions are the only way to perform some tasks without using up an unreasonable amount of screen space. Lua syntax is different and does not derive nearly as much of a benefit, as there is literally not a single place in Lua where an assignment _expression_ would save more than a single line of code. Clumsy constructions will remain clumsy; elegant constructions won't become more elegant.

Given that this discussion STARTED with pointing out a new feature in Python, it's rather difficult to interpret that as anything but a supporting argument.
 
> The other problem you cite I consider to be an additional reason NOT to do it. If making good use of something requires expanding the scope of the change, that's a big red flag, especially in a language whose design is as conservative as Lua's.

I am afraid I cannot deduce unambiguously what "other problem" you reference here, neither do I understand what "change" and "expanding the scope" you mean - I certainly proposed none. Care to explain?

Cheers,
V.

The latter half of your message, talking about multiple assignments and new semantics.

/s/ Adam