From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4327 invoked by alias); 13 Feb 2017 21:58:45 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22464 Received: (qmail 27776 invoked from network); 13 Feb 2017 21:58:45 -0000 X-Qmail-Scanner-Diagnostics: from mta04.eastlink.ca by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(24.224.136.10):SA:0(-0.7/5.0):. Processed in 1.335347 secs); 13 Feb 2017 21:58:45 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RP_MATCHES_RCVD,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: rayandrews@eastlink.ca X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.eastlink.ca designates 24.224.136.10 as permitted sender) X-Authority-Analysis: v=2.2 cv=DOfN2GFb c=1 sm=1 tr=0 a=aWG3ZaPfpGbmBTXoUM+q2Q==:117 a=aWG3ZaPfpGbmBTXoUM+q2Q==:17 a=IkcTkHD0fZMA:10 a=HvugOErretQ8HNBuBYIA:9 a=QEXdDO2ut3YA:10 X-EL-IP-NOAUTH: 24.207.17.185 Subject: Re: padding. To: zsh-users@zsh.org References: <0befdb38-eaa5-6388-a3fe-58b1a73834b7@eastlink.ca> <170211110437.ZM467@torch.brasslantern.com> <20170212061455.GA4267@fujitsu.shahaf.local2> From: Ray Andrews Message-id: <123535f0-62f3-3e32-3e83-d1c98d8eb7d9@eastlink.ca> Date: Mon, 13 Feb 2017 13:58:37 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 MIME-version: 1.0 In-reply-to: <20170212061455.GA4267@fujitsu.shahaf.local2> Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 7bit On 11/02/17 10:14 PM, Daniel Shahaf wrote: > > % if false; then if true; fi > % setopt noshortloops > % if false; then if true; fi > zsh: parse error near `fi' > > I'm guessing the second 'if' is parsed using the SHORT_LOOPS syntax, > with an empty sublist. I'm not sure whether that's a bug: is the > sublist in the SHORT_LOOPS syntax allowed to be null? Well no one else has commented on it, but I don't know how it could not be a bug, tho this 'shortloops' must be there for a reason. Docs refer to the 'short form' of various constructs but what's the point of it here? I see the use with 'while', but with 'if' it seems trivial. I see it as just letting me get away with mistakes. > >> and: >> >> $ if [ "$1" = "start" ]; then >> # if [ "$1" = 'null' ] && return >> fi >> >> (no message) > That's expected. Yes, it's just there as contrast for the questionable one.