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 37108
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: PATCH: nested ${(P)} (formerly SHWORDSPLIT and leading spaces)
- Date: Sat, 14 Nov 2015 10:51:34 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern_com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=/xNghNS1t68H/XDQ025JWym7rc47DvsQriL1o2n8New=; b=R5cRzUw9tCoUgk1oHr7QbhUFZQk6Q3JDoMJ5XGqZ7ypmsZFigLmHLqeLCZNbRg0uEj QO6VxP68xUf6s0DhcgA9WtphMj6WVcsElUFfIO0t4CAXKf3Rx1OzAg4Cnb0wcLGnK+wY oQKnml/iqf6r19DZTvB0Q2RJ65gpSXCkwSq5IWOIh7M68VgrFSzN78qQg9DtRk9qCwZD gImTwJ6M36LUp9Swun1tO45/Qrs96FJUS2ZNmhob8iBmQd5yUTT1fXXshFOms2fwOrjD CNM6S31UzFFGTUK9PTma8+CkYjWtnJS1YpO1O2ws/7OgQZhQX7i1uexC64ZKRiEpGR46 ljvQ==
- In-reply-to: <f6164db7-fc34-4bee-b353-197626b51909@email.android.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
- References: <f6164db7-fc34-4bee-b353-197626b51909@email.android.com>
On Nov 14, 9:45am, Peter Stephenson wrote:
}
} 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.
I think it's more subtle than that. It occurs only when:
1. there is an outer ${...} around the ${(P)...} expansion
2. the (P) is combined with one of (l), (r), or (j).
If there's only one level, ${(Pr.N.)...} et al. work as expected.
So I suspect that the specific code path(s) used by padding and joining
are failing to turn off the flag bit that indicates the value has been
fetched already, causing the outer ${ } to unnecessarily attempt again
to fetch the value. Or something like that.
--
Barton E. Schaefer
Messages sorted by:
Reverse Date,
Date,
Thread,
Author