From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9389 invoked from network); 26 Feb 1997 17:19:12 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 26 Feb 1997 17:19:12 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id MAA11361; Wed, 26 Feb 1997 12:03:55 -0500 (EST) Resent-Date: Wed, 26 Feb 1997 12:03:55 -0500 (EST) From: "Bart Schaefer" Message-Id: <970226091139.ZM16361@candle.brasslantern.com> Date: Wed, 26 Feb 1997 09:11:39 -0800 In-Reply-To: (Zoltan T. Hidvegi) "Re: Short loops?" (Feb 26, 11:10am) References: <9702261610.AA15701@lotto.fishkill.ibm.com> Reply-To: schaefer@nbn.com X-Mailer: Z-Mail (4.0b.820 20aug96) To: (Zoltan T. Hidvegi) Subject: Re: Short loops? Cc: zsh-workers@math.gatech.edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"osKvc3.0.Pn2.xp65p"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2928 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Feb 26, 11:10am, (Zoltan T. Hidvegi) wrote: > Subject: Re: Short loops? > > 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 > {. The doc ought to get changed, then. The two entries for `while' (and similarly for all the "short" variants) read: `while LIST do LIST done' `while LIST { LIST }' The first and second uses of LIST both require either a newline or a trailing semicolon; the fourth use of LIST may have a newline or a semicolon or not, without affecting the result; and the third use requires not only that there NOT be a newline or semicolon, but also that the list ends with a [[ ]] (( )) ( ) or { } construct. This is, if you ask me, completely bogus from a consistency standpoint, not only in the doc but in the behavior; but its worse that the doc makes it appear consistent when it isn't. Furthermore, it's not just the case that zsh must be able to "detect the end of the list before reading the {" because this: while true { echo foo } doesn't work either, yet `true { ...' is in no sense a valid list. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.nbn.com/people/lantern