[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: New scoping rule for "repeat" and "continue" patch
- From: "Aaron Brown" <aaron-lua@...>
- Date: Tue, 4 Oct 2005 11:54:11 -0400
Diego Nehab wrote:
> In the old style, you would need to declare "done" outside
> of the "repeat" loop in order to be able to read its value
> in the until expression.
> First, this makes it less obvious that "done" is in fact
> only used inside your repeat block. Second, you can't use
> a on-liner anymore.
David Given responded:
> [...] I think it violates the Principle of Least
> Astonishment. I wouldn't *expect* the 'until' to be in
> the scope of the block inside, because (a) that's not how
> other Algol-ish languages do it, and (b) it's not visually
> part of the block.
Good points, but let me chime in that on the first of the
two or so times when I've felt the need to use repeat...until,
I expected the until expression to be included in the
block's scope, for exactly the reasons that Diego gives