zsh-workers
 help / color / mirror / code / Atom feed
From: <hzoli@VNET.IBM.COM> (Zoltan T. Hidvegi)
To: schaefer@nbn.com
Cc: zsh-workers@math.gatech.edu
Subject: Re: Short loops?
Date: Wed, 26 Feb 1997 11:10:56 -0500 (EST)	[thread overview]
Message-ID: <9702261610.AA15701@lotto.fishkill.ibm.com> (raw)
In-Reply-To: <970225181321.ZM13319@candle.brasslantern.com> from Bart Schaefer at "Feb 25, 97 06:13:21 pm"

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


  reply	other threads:[~1997-02-26 16:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-26  2:13 Bart Schaefer
1997-02-26 16:10 ` Zoltan T. Hidvegi [this message]
1997-02-26 17:11   ` Bart Schaefer
1997-02-26 17:26     ` Zoltan T. Hidvegi
1997-02-26 19:09       ` Bart Schaefer
1997-02-26 19:27         ` Zoltan T. Hidvegi
1997-02-26 21:14           ` Bart Schaefer
1997-02-27  9:32             ` Peter Stephenson
1997-02-27 15:06               ` Zoltan T. Hidvegi
1997-02-27 18:16               ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9702261610.AA15701@lotto.fishkill.ibm.com \
    --to=hzoli@vnet.ibm.com \
    --cc=schaefer@nbn.com \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).