Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Short `if'



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