[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] Lua 5.2.0 (beta-rc1) goto syntax
- From: Edgar Toernig <froese@...>
- Date: Thu, 16 Jun 2011 17:58:55 +0200
> Some real contenders:
> [label syntax]
I think, the current syntax is OK (as would be ::label::).
What is more important to me, is the syntax of the goto statement.
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. Usually, the intention of a backward jump is
to redo some code and that of a forward jump is to skip code - two
distinct concepts that should be distinguishable by the jump-state-
ment itself, not by some far away label statement.
If the jump statement gives a hint about the direction you don't
have to search for the label to get an idea of what's going on.
And if you want to locate the actual target, you already know the
direction you have to look.
I don't care that much about the actual syntax. Some ideas:
- "backto label"/"skipto label"
- "goto <label"/"goto >label"
- [fill in________________]