lua-users home
lua-l archive

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


2018-01-28 10:52 GMT+02:00 KHMan <keinhong@gmail.com>:

> I'd like a native switch. :-) Please, pretty pretty please :-)

So which do you want? Like Pascal's 'case' statement [1]
or like C's 'switch' statement?

Personally I heartily detest the C 'switch'. You need to put
'break' all over the place. I never use the fall-through trick.
It's a fast-track to lurking bugs.

I am willing to keep an open mind on 'case'. I don't
really think Lua needs it, but the workarounds are not pretty.

[1] I was a Pascal user from Wirth's first report until one
needed p2c to run it under Linux. Now that Free Pascal
has reached stability, I use Pacal again. Think of it as
C with Lua readability. One can write Lua API code in
Pascal and call Lua code from Pascal.