From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21736 invoked by alias); 25 Nov 2014 07:49:39 -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: 19429 Received: (qmail 1507 invoked from network); 25 Nov 2014 07:49:36 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=MJ3XQ3dg c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=5y4faFyK3SkA:10 a=Os1A4nMZMMiVkZxVpl8A:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <141124234931.ZM17259@torch.brasslantern.com> Date: Mon, 24 Nov 2014 23:49:31 -0800 In-reply-to: <20141124211831.GA17829@chaz.gmail.com> Comments: In reply to Stephane Chazelas "Re: ${^var} and word splitting" (Nov 24, 9:18pm) References: <20141124095637.GA5716@chaz.gmail.com> <20141124111201.161d8cf2__23261.8202259347$1416827641$gmane$org@pwslap01u.europe.root.pri> <20141124152628.GA5749@chaz.gmail.com> <20141124155524.0739b3ec__26419.4987401881$1416845250$gmane$org@pwslap01u.europe.root.pri> <20141124211831.GA17829@chaz.gmail.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh hackers list Subject: Re: ${^var} and word splitting MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Nov 24, 9:18pm, Stephane Chazelas wrote: } } I don't see the point in doing one and not the other. IOW in: } } ~$ a=' a b ' zsh -c 'print -l ${(s, ,)a}' } a } b } ~$ a=' a b ' zsh -c 'print -l "${(s, ,)a}"' } } a } b } } ~$ a=' a b ' zsh -c 'print -l "${(s, ,@)a}"' } } a } } b } } ~$ } } I'd rather 2 above behave either like 1 or 2. (Working with the presumption you mean "like 1 or 3".) This may go back to a misinterpretation of documentation -- there are a lot of little things about zsh that got that way because e.g. examples in the ksh88 documentation were implemented without completely knowing what was BNF-style markup and what was actual syntax. Nevertheless I think the intention was that #2 is "collapse consecutive whitespace to a single space and then act like #3". In any case it all depends on where you apply the (@): % a=' a b ' zsh -c 'print -l "${(@)${(s, ,)a}}"' a b % } It may be too late to change the behaviour now, though I'd find } it hard to imagine people relying on "$=var" to make empty } arguments at the beginning and end but not in the middle. I have the nagging suspicion there may be cases in the completion code that expect exactly that ... or that have been programmed to work around it and would need to be fixed if it changes. -- Barton E. Schaefer