lua-users home
lua-l archive

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




On Thursday, June 26, 2014, Liam Devine <liamdevine@oolua.org> wrote:
On 26/06/14 05:53, Dirk Laurie wrote:
>
> 2014-06-25 22:41 GMT+02:00 Axel Kittenberger <axkibe@gmail.com>:
>>> Unfortunately it still does not explain why there is no continue in Lua
>>> but break exists. This is one of my major hate.
>>
>> Yes, break should go away, its just bloating the language, it can just as
>> easily be modeled with a goto statement, as we don't need a continue since
>> we have goto.
>
> That's sarcasm, right? I'm still working on recognizing sarcasm.
>
If Dirk then goto sarcasm else goto reality end
::sarcasm::
I would suggest that repeat, while and for should be removed from the
language as they can be implemented with gotos. For some situations this
can even produce the exact same instructions.

::reality::
A while back, I struggled to find one person that uses the goto keyword.

--
Liam


I use it all of the time. But then I remove it. 

It's the same with continue, except that I imagine the reason to be different. I took a decade's break from programming and started up with Lua. Not having `continue`, I'm guessing that I didn't organize loops in that way. Every so often, I think I need it, but eventually, as then solution developes I end up removing it. 

I suspect that with goto, it's slightly different, in that I suspect that I was never smart enough to use it well. When I try to use it, it's in some kind of progressive state machine, but eventually, the more familiar patterns prevail and I can't justify my own fanciness. 

-Andrew