[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: The meaning of 'sugar' [Forked from Re: Why do we have ipairs?]
- From: Paige DePol <lual@...>
- Date: Fri, 13 Jun 2014 15:03:17 -0500
On Jun 13, 2014, at 2:50 PM, Tomas Guisasola Gorham <tomas@tecgraf.puc-rio.br> wrote:
> Hi
>
> On Fri, 13 Jun 2014, Paige DePol wrote:
>
>> Tomás, please see earlier posts on this thread that discuss the differences between switch statements and function-table constructs so the conversation doesn't go in circles!
>>
>> Also no, I do not use that type of construct, I much prefer the cleaner style of the switch statement and the extra functionality it can provide... which is why I created the switch patch! ;)
> Sorry about the noise. I should have written the "constants"
> between parentheses, as Adam pointed out in his message.
> Anyway, what I was trying to say is that when the if-elseif
> chain becomes a little longer, this construction seems much better.
> For me at least. I don't even think about a switch statement...
>
> Regards and sorry about the noise,
> Tomás
If what you have works for you, and you are happy with it, then use it! :)
Personally, I am creating a variant of Lua for a game engine I am also writing. This gives me the opportunity to learn how the Lua VM works from the inside out, and to add features to my new language that I want... like switch!
~pmd