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

Re: PATCH: nested ${(P)} (formerly SHWORDSPLIT and leading spaces)



On 14 Nov 2015 01:33, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Nov 14, 12:07am, Jun T. wrote: 
> } 
> } It seems ${${(Pr.n.)name}} is behaving like ${(P)${(r.n.)name}}. 
> } Instead, the expected behavior may be ${(r.n.)${(P)name}}. 
>
> Yes, that definitely seems to be the issue.

(On my mobile at the moment so lacking in linr breaks.) 

Sorry, I obviously didn't explain the change properly.  The new behaviour is both expected and necessary to have the clean separation between levels of nesting: if a (P)  occurs inside multiple braces, the immediately surrounding level deals with the parameter name, and the outer level deals with the value. That's the only way to implement this in a workable fashion. If the old kludge where it's mixed together is needed for compatibility, we'll need to go back to the old state (and leave it permanently - it is not compatible with a properly nested form of the (P)  flag). Or, of course, we can update the documentation, or, yuk, use a different flag and deprecate the old one.

pws


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