From: Bart Schaefer <schaefer@brasslantern.com>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: PATCH: nested ${(P)} (formerly SHWORDSPLIT and leading spaces)
Date: Wed, 11 Nov 2015 10:13:10 -0800 [thread overview]
Message-ID: <CAH+w=7YvzTJp_cKCPut4L_bhX3ePcRQabfhk1BoLmV85jYTjHg@mail.gmail.com> (raw)
In-Reply-To: <20151111174911.4384bf73@pwslap01u.europe.root.pri>
[-- Attachment #1: Type: text/plain, Size: 623 bytes --]
On Nov 11, 2015 9:59 AM, "Peter Stephenson" <p.stephenson@samsung.com>
wrote:
>
> This isn't obviously broken, yet. You can explore while I think about
> tests.
Nifty.
> Hmmm... should I sanity check that the the substituted name is an
> identifier, or is it a feature that
>
> % array=(one two three)
> % word='array[2]'
> % print ${${(P)word}[2]}
> w
>
> works?
I've used that trick before, though the context was with nested (P) not
working. I guess I'd leave it as a feature ... essentially if the value
would be legal as the left side of an assignment, it should be OK here.
Check ${(P)thing::=newvalue} too ...
next prev parent reply other threads:[~2015-11-11 18:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-06 10:54 Inconsistency with SHWORDSPLIT and leading spaces Christian Neukirchen
2015-11-06 17:00 ` Peter Stephenson
2015-11-07 17:42 ` Peter Stephenson
2015-11-07 19:43 ` Bart Schaefer
2015-11-08 18:18 ` Peter Stephenson
2015-11-08 18:55 ` Bart Schaefer
2015-11-09 6:03 ` Bart Schaefer
2015-11-11 17:49 ` PATCH: nested ${(P)} (formerly SHWORDSPLIT and leading spaces) Peter Stephenson
2015-11-11 18:13 ` Bart Schaefer [this message]
2015-11-11 21:55 ` Peter Stephenson
2015-11-12 9:46 ` Peter Stephenson
2015-11-12 14:19 ` Peter Stephenson
2015-11-13 8:17 ` Jun T.
2015-11-13 15:07 ` Jun T.
2015-11-14 1:33 ` Bart Schaefer
2015-11-14 9:45 ` Peter Stephenson
2015-11-14 18:51 ` Bart Schaefer
[not found] <0faa0ee3-303a-4cb5-a270-d3d1787accf1@email.android.com>
2015-11-15 5:14 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAH+w=7YvzTJp_cKCPut4L_bhX3ePcRQabfhk1BoLmV85jYTjHg@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=p.stephenson@samsung.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).