Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Short `if'
- X-seq: zsh-workers 15263
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: Peter Stephenson <pws@xxxxxxx>, zsh-workers@xxxxxxxxxx (Zsh hackers list)
- Subject: Re: Short `if'
- Date: Thu, 5 Jul 2001 16:25:23 +0000
- In-reply-to: <Tc0a88d015490060f74@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <Tc0a88d015490060f74@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <200107051359.PAA10777@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <003101c1055d$356b0cb0$21c9ca95@xxxxxxxxxxxxxx>
On Jul 5, 2:57pm, Peter Stephenson wrote:
} Subject: Short `if'
}
} I can't get the short form of `if' to work, described in the manual as:
}
} if LIST SUBLIST
} A short form of the alternate `if'.
}
} What am I doing wrong?
The documentation does explain this:
The short versions below only work if SUBLIST is of the form
`{ LIST }' or if the SHORT_LOOPS option is set. In this case,
the test part of the loop must also be suitably delimited, such
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
as by `[[ ... ]]' or `(( ... ))', else the end of the test will
not be recognized.
"In this case" does NOT mean "if the SHORT_LOOPS option is set." It
should probably say "in either of these cases ..."
If I (dimly) recall correctly, the documentation originally said:
The short versions below only work if SUBLIST is of the form
`{ LIST }'. In this case, ...
And then later the SHORT_LOOPS option was added and the "or if ..." was
stuck into the sentence without fixing the rest of it.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author