From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9149 invoked from network); 26 Feb 1997 16:36:55 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 26 Feb 1997 16:36:55 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id LAA10065; Wed, 26 Feb 1997 11:20:00 -0500 (EST) Resent-Date: Wed, 26 Feb 1997 11:20:00 -0500 (EST) From: (Zoltan T. Hidvegi) Message-Id: <9702261610.AA15701@lotto.fishkill.ibm.com> Subject: Re: Short loops? In-Reply-To: <970225181321.ZM13319@candle.brasslantern.com> from Bart Schaefer at "Feb 25, 97 06:13:21 pm" To: schaefer@nbn.com Date: Wed, 26 Feb 1997 11:10:56 -0500 (EST) Cc: zsh-workers@math.gatech.edu X-Mailer: ELM [version 2.4ME+ PL31 (25)] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"6yXvo.0.AT2.lA65p"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2927 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Bart Schaefer wrote: > Nobody responded to my message to zsh-users about `while LIST { LIST }` > syntax. Is this syntax broken by accident or on purpose? Sorry for the silence. I've got a new job and moved to the US, that's why I was a bit silent recently. I'd like to buy a computer at home within a few weeks and than I'll have more time to work on zsh again. So, the while syntax is not broken. As you write above, while LIST { LIST } works. But while foo ; { bar } is just while LIST because foo ; { bar } is a list in itself. The above syntax only works if zsh can detect the end of the LIST before reading the {. This works: integer i=0 while ((i++ < 10)) { echo $i } That's because ((i++ < 10)) { echo $i } is not a valid listso zsh can detect that the list ends in )). Similarily [[ ... ]] { ... } works as well. It is the same as if [[ ... ]] then works without a semicolon before then but if true; then doesn't. Zoltan