[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.2.0 (beta-rc1) goto syntax
- From: HyperHacker <hyperhacker@...>
- Date: Thu, 16 Jun 2011 12:21:28 -0600
On Thu, Jun 16, 2011 at 11:27, David Kastrup <dak@gnu.org> wrote:
> Edgar Toernig <froese@gmx.de> writes:
>
>> David Kastrup wrote:
>>> Edgar Toernig <froese@gmx.de> writes:
>>>
>>> > In my experience, it helps reading and understanding code if the
>>> > jump-statement gives a hint about the direction the jump takes,
>>> > forward or backward.
>>>
>>> A common use case for goto is the implementation of state machines. It
>>> would complicate the generation of them if you had to specify the
>>> direction where the label is to be found.
>>
>> Hmm... for some definition of "complicate", yes. But at the same time
>> you help later readers to find the target state in the code (code is
>> read more often then written, so time spent making reading easier pays
>> off).
>
> That's what comments are for.
>
> --
> David Kastrup
>
>
>
I suppose there's no technical reason you couldn't have all three:
backto future --to redo
skipto myloo --to skip ahead
goto heck --to jump to a label whose relative position we don't know yet
--
Sent from my toaster.
- References:
- [ANN] Lua 5.2.0 (beta-rc1) now available, Luiz Henrique de Figueiredo
- Re: [ANN] Lua 5.2.0 (beta-rc1) now available, Alexandre Erwin Ittner
- Re: [ANN] Lua 5.2.0 (beta-rc1) now available, Frank Meier-Dörnberg
- Re: [ANN] Lua 5.2.0 (beta-rc1) now available, David Kastrup
- Re: [ANN] Lua 5.2.0 (beta-rc1) now available, Frank Meier-Dörnberg
- Re: [ANN] Lua 5.2.0 (beta-rc1) now available, Eduardo Ochs
- Re: [ANN] Lua 5.2.0 (beta-rc1) now available, Frank Meier-Dörnberg
- Re: [ANN] Lua 5.2.0 (beta-rc1) now available, David Given
- Re: [ANN] Lua 5.2.0 (beta-rc1) now available, Roberto Ierusalimschy
- Re: [ANN] Lua 5.2.0 (beta-rc1) goto syntax, Edgar Toernig
- Re: [ANN] Lua 5.2.0 (beta-rc1) goto syntax, David Kastrup
- Re: [ANN] Lua 5.2.0 (beta-rc1) goto syntax, Edgar Toernig
- Re: [ANN] Lua 5.2.0 (beta-rc1) goto syntax, David Kastrup