lua-users home
lua-l archive

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


On Sat, May 3, 2014 at 2:30 PM, Philipp Janda <siffiejoe@gmx.net> wrote:

> Often "I can" is just an alias for "I like", and you will get "I can
> without" as answer -- unless you really can't without. But the process of
> taking values out of a table and putting them into local variables is very
> possible in Lua.

local a, b, c in some_table

^ this is both something [some] people like, and something that can
help people think about a problem more clearly/cleanly.  Others could
argue that "local a, b, c = some_table.a, some_table.b, some_table.c"
is better, but it is a valid point that proper sugar can more clearly
convey a concept.  It's not simply about 'like'.

Otherwise we could say that some_table.a, some_table.b, some_table.c
is sugar and that we should instead be dealing with Lua VM opcodes.
Sugar is not always a want, there can be a need.

> Probably because it had nothing to do with syntax :-p

I'm just saying, it was "downvoted" at the time but still made it
upstream.  It was a valid proposal that was instead shot down with
"Why would you need to?" and "You can do it this convoluted way..."  I
think the list suffers from people who refuse to recognize a need, in
favor of minimalism that stifles growth -- in any direction (even
smaller).