From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23503 invoked by alias); 6 Jan 2010 15:23:25 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 27575 Received: (qmail 18378 invoked from network); 6 Jan 2010 15:23:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <100106072305.ZM4436@torch.brasslantern.com> Date: Wed, 06 Jan 2010 07:23:05 -0800 In-reply-to: <22a0ef081001051452g4066b985nef6ac1e9a60e4de9@mail.gmail.com> Comments: In reply to Michael Hwang "Re: [PATCH]: Revamped (P) expansion flag" (Jan 5, 5:52pm) References: <22a0ef080912261448x3d14b301yc4082a924cd760d8@mail.gmail.com> <20100105172012.3f1d628c@news01> <22a0ef081001051452g4066b985nef6ac1e9a60e4de9@mail.gmail.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: [PATCH]: Revamped (P) expansion flag MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jan 5, 5:52pm, Michael Hwang wrote: } Subject: Re: [PATCH]: Revamped (P) expansion flag } } > As ${(P)REF} is really ${(P)${REF}}, one would think that that } > ${(P)REF[1,3]} would be expanded as ${(P)${REF}[1,3]}. But as you can } > see, it is instead expanded as ${(P)${REF[1,3]}}. } } I believe that the behavior that test relies on should be considered a } bug. What do you think? I think you haven't read manual section 14.3.2 (subsection "Rules" under "Parameter Expansion"). The only value manipulations that are applied before the subscripts are computed are those that are properties of the parameter itself, such as internal padding and capitalization. To change this for any one expansion-time flag such as (P) would be a serious departure from long-standing semantics. It's not a bug.