Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH]: Revamped (P) expansion flag



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.



Messages sorted by: Reverse Date, Date, Thread, Author