[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: switch statement
- From: Norman Ramsey <nr@...>
- Date: Mon, 07 Dec 1998 11:12:54 -0500
> How hard is it to add a switch statement to lua. Currently I am
> using if then elseif statements - switch case statements would
> be more efficient and also more readable.
It's pretty easy --- I posted patches to this list a year or two ago,
but they are for Lua 2.5. The results are much more readable but not
more efficient---because I wanted to switch on arbitrary values,
especially strings, the switches are implemented much as a sequence of
if-then-elses.
Norman