Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: nested ${(P)} (formerly SHWORDSPLIT and leading spaces)
- X-seq: zsh-workers 37107
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: PATCH: nested ${(P)} (formerly SHWORDSPLIT and leading spaces)
- Date: Sat, 14 Nov 2015 09:45:17 +0000
- Cc: zsh-workers@xxxxxxx
- In-reply-to: <151113173324.ZM393@torch.brasslantern.com>
- 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
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