Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH]: Revamped (P) expansion flag
- X-seq: zsh-workers 27570
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH]: Revamped (P) expansion flag
- Date: Wed, 6 Jan 2010 09:48:19 +0000
- In-reply-to: <22a0ef081001051452g4066b985nef6ac1e9a60e4de9@xxxxxxxxxxxxxx>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Organization: CSR
- References: <22a0ef080912261448x3d14b301yc4082a924cd760d8@xxxxxxxxxxxxxx> <20100105172012.3f1d628c@news01> <22a0ef081001051452g4066b985nef6ac1e9a60e4de9@xxxxxxxxxxxxxx>
On Tue, 5 Jan 2010 17:52:47 -0500
Michael Hwang <michael.a.hwang@xxxxxxxxx> wrote:
> On Tue, Jan 5, 2010 at 12:20 PM, Peter Stephenson <pws@xxxxxxx> wrote:
> > With the two patches I know about (the second a single line), the test
> > suite now fails at this test in D06subscript.ztst:
>
> On Sat, Dec 26, 2009 at 5:48 PM, Michael Hwang
> <michael.a.hwang@xxxxxxxxx> wrote:
> > On the more buggy-ish side:
> >
> > % STRING='zsh is awesome!'
> > % STR='zsh sucks... :-/'
> > % REF=STRING
> > % print ${(P)REF[1,3]}
> > zsh sucks... :-/
> >
> > 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?
The test isn't very logical without the $. If I put them into the test,
qqq=lower
QQQ=upper
print ${(P)${A[one\"two\"three\"quotes]}}
print "${(P)${A[$A[(i)one\"two\"three\"quotes]]}}"
0:Keys with double quotes and the (P) expansion flag
>lower
>upper
it still fails, however: the first output is now "lower" as before,
but the second output is "lower" too whereas before (even in this form of
the test) it was "upper". Something has changed in the way quoting is
done. There may be a logical explanation for this.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
Messages sorted by:
Reverse Date,
Date,
Thread,
Author