[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Predefined labels (Inspired by discussion on: Why do we have ipairs?)
- From: Patrick Donnelly <batrick@...>
- Date: Thu, 3 Jul 2014 09:43:28 -0400
Dirk,
Fascinating idea, thanks for sharing!
On Thu, Jul 3, 2014 at 1:10 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 2014-07-03 0:18 GMT+02:00 Paige DePol <lual@serfnet.org>:
>
>
>> Also code wise, if I see "goto {something}" I am going to be
>> looking for a {something} label, however, if I see `break` or
>> `continue` I know what to expect, and I know the language
>> has already facilitated placing labels for those keywords
>> in the correct places. To me, `goto break` or `goto continue`
>> just looks like someone was confused when writing the code! ;)
>
> How about `→continue` and `→redo`? Then `→break` simply
> fits the pattern. (Thanks for the `redo`, Philipp, it's much more
> intuitive than what I had).
Why not "continue;" and "break;" be syntactic sugar for "goto
continue;" and "goto break;"? Lua already does not allow a Name to be
a statement. [What would the formal/technical way to say that be?]
Best part is it's backwards compatible. Worst part is its use for
other labels would make goto look that much more evil.
--
Patrick Donnelly