From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16555 invoked by alias); 3 Jan 2013 19:42:58 -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: 17532 Received: (qmail 20990 invoked from network); 3 Jan 2013 19:42:45 -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 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <130103114217.ZM6362@torch.brasslantern.com> Date: Thu, 03 Jan 2013 11:42:17 -0800 In-reply-to: <20130102232813.GG2054@localhost.localdomain> Comments: In reply to Han Pingtian "Re: PATCH and more remarks on parameter expansion docs" (Jan 3, 7:28am) References: <121230112044.ZM879@torch.brasslantern.com> <20121231233002.GC2054@localhost.localdomain> <130101211501.ZM3814@torch.brasslantern.com> <20130102083224.GF2054@localhost.localdomain> <130102084644.ZM4876@torch.brasslantern.com> <20130102232813.GG2054@localhost.localdomain> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: PATCH and more remarks on parameter expansion docs MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jan 3, 7:28am, Han Pingtian wrote: } Subject: Re: PATCH and more remarks on parameter expansion docs } } On Wed, Jan 02, 2013 at 08:46:44AM -0800, Bart Schaefer wrote: } > } > Note that splitting is applied to WORD in the assignment forms of } > SPEC _before_ the assignment to NAME is performed. This affects } > the result of array assignments with the A flag. } } I think it doesn't say this splitting _before_ assignments is only true } when (A) is used. Looks like if (A) wasn't used, splitting will _after_ } the assignments Ah, I see. OK, I agree that it's imprecise about this. It's imprecise but not in the way that you think: The splitting is in fact done before the assignment in either case, but at that point the internals have both the expanded string and the split result available. The (A) flag then determines which of those two values is used in the assignment. I'm not sure whether in practice this can ever have a visible effect. In theory if there were some oddity with the syntax of WORD that caused the splitting step to fail, then the NAME parameter would not be assigned, but I can't trivially produce an example. On the other hand, when does this "mistake" in the documentation matter? Given what it says, what did you expect ${=xx::=foo bar} to assign? The doc needs to strike a balance between giving so much detail that it's confusing and too little to tell the user what to expect.