From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9909 invoked from network); 26 Feb 1997 21:20:01 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 26 Feb 1997 21:20:01 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id QAA20195; Wed, 26 Feb 1997 16:06:24 -0500 (EST) Resent-Date: Wed, 26 Feb 1997 16:06:24 -0500 (EST) From: "Bart Schaefer" Message-Id: <970226131410.ZM16925@candle.brasslantern.com> Date: Wed, 26 Feb 1997 13:14:10 -0800 In-Reply-To: (Zoltan T. Hidvegi) "Re: Short loops?" (Feb 26, 2:27pm) References: <9702261927.AA16863@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: <"Y2tuk3.0.Ux4.FNA5p"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2932 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Feb 26, 2:27pm, (Zoltan T. Hidvegi) wrote: > Subject: Re: Short loops? > > Bart Schaefer wrote: > > misleading. The /bin/sh manual can get away with `while LIST do LIST done' > > because in /bin/sh the semicolon or newline at the end of a LIST is never > > optional (the definition of LIST *includes* the trailing separator in the > > /bin/sh manuals). > > Then the /bin/sh manual is wrong. if (true) then (echo foo) fi works fine > in sh. Hmm. Yup, you're right; I dug up my hardcopy of the 4.2 BSD `sh' man page. I withdraw that objection. Nevertheless, the point is that the "optional" terminator mentioned in the definition of a "list" is not optional in the short forms. It *must* be left out. > > The doc could define a CLOSED construct to be any of (( )) [[ ]] ( ) { }, > > and define a CLOSEDLIST to be a LIST ending with a CLOSED but that is NOT > > followed by the optional separator. > > Yes, but that would make the manual quite verbose repeating the same thing > many times. Why would that cause it to repeat itself more than it already does? However, if something close to this text: } If you interpret LIST as the longest string which is synactically a list } than it is correct. In while true ; { echo foo } the longest possible list } is true ; { echo foo }. were added to the section on alternate forms, that would probably clarify enough. Maybe also move the reserved words section above the alternate forms, but that helps only when reading sequentially through the info. Peter, how about adding something about this to the FAQ as well? -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.nbn.com/people/lantern