lua-users home
lua-l archive

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


On 1/28/2018 11:02 PM, Paige DePol wrote:
Dibyendu recently started a discussion about wether or not Lua has reached
perfection. Of course, this will be a subject highly dependant on the need
and opinions of each user of Lua.

On that same discussion topic the desire for a switch/case like construct
in Lua came up... so I thought I would start a new discussion thread to
see what features people would like to see added to vanilla Lua.

To elaborate a bit on my previous postings: I was reading Peter's posting and switch/case was the first thing that popped into my head, so I used that as an example for the topic under discussion. The size of the SwitchStatement page on the Lua wiki leads one to think, why? It's a kind of "rumblings of discontent", hence imperfection.

I think certain thinking processes when coding translates well to a switch/case kind of construct, but it doesn't happen often (well, depends). When it happens, the coder stops and asks, why can't I use switch/case here?

Perhaps C/Pascal switch/case came historically somewhere at the point where a full set of control structures has materialized, and so C is being used as a useful baseline for feature comparison.

It's true that in Lua there are many alternatives to C/Pascal style switch/case, and we can get by without it, but the main thing that bugs me today is that the intent of the coder was not expressed in the clearest possible way.

So, if you could add any one feature to Lua right now, what would that
feature be and why would you want to see it added? Please note that this
discussion is in no way meant to be interpreted as pressuring Team Lua to
add any features to Lua, I am genuinely curious what features people want
to see added to Lua and why.

My interest in this subject isn't just academic, however, I may take some
of these ideas on board to add to my hard fork of Lua. If so, I would also
create patches for vanilla Lua as well! :)


--
Cheers,
Kein-Hong Man (esq.)
Selangor, Malaysia