zsh-users
 help / color / mirror / code / Atom feed
From: Han Pingtian <hanpt@linux.vnet.ibm.com>
To: zsh-users@zsh.org
Subject: Re: PATCH and more remarks on parameter expansion docs
Date: Wed, 2 Jan 2013 16:32:24 +0800	[thread overview]
Message-ID: <20130102083224.GF2054@localhost.localdomain> (raw)
In-Reply-To: <130101211501.ZM3814@torch.brasslantern.com>

On Tue, Jan 01, 2013 at 09:15:01PM -0800, Bart Schaefer wrote:
> On Dec 27,  3:08pm, Han Pingtian wrote:
> } Subject: Re: splitting in assignment forms of expansion
> }
> } I think we should say something like this about this feature in the man
> } page:
> }
> }     Note during assignments with the A flag, that splitting is applied 
> }     to word in the assignment forms of spec before the assignment to
> }     name is performed. This will affects the result.
> 
> I added something similar in the patch.
Thanks your nice patch. But I'm still wondering why not change the
statements after "${=spec}" in man page. Or I'm misunderstanding the
original statements which has been stating this "splitting before
assignment" behavior is only related to "(A)" flag? 
> 
> 
> The (t) flag is an oddball.  If combined with (P) [rule 4], it takes
> effect after that name replacement.  However, if *not* combined with
> (P), then it takes effect *before* subscripting [rule 3].  Thus:
> 
>     % x=path
>     % print ${(t)x}
>     scalar
>     % print ${x[2,4]}
>     ath
>     % print ${(t)x[2,4]}
>     cal
>     % print ${(tP)x}
>     array-unique-special
> 
> I might have expected ${(t)x[2,4]} to print the type of the variable
> named "ath", but that isn't what happens.  So I haven't attempted to
> work it into the rules, but it's a perfect example of how parameter
> expansion syntax lacks well-defined precedence.
Yep, it looks like there are quite some special cases. 


  reply	other threads:[~2013-01-02  8:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-30  9:44 Creating A Clean Environment For Autoloaded Functions Russell Harmon
2012-12-30 19:20 ` Bart Schaefer
2012-12-30 21:02   ` Russell Harmon
2012-12-30 22:12     ` Bart Schaefer
2012-12-31 23:30   ` Han Pingtian
2013-01-02  5:15     ` PATCH and more remarks on parameter expansion docs Bart Schaefer
2013-01-02  8:32       ` Han Pingtian [this message]
2013-01-02 16:46         ` Bart Schaefer
2013-01-02 23:28           ` Han Pingtian
2013-01-03 19:42             ` Bart Schaefer
2013-01-03 22:18               ` Han Pingtian

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=20130102083224.GF2054@localhost.localdomain \
    --to=hanpt@linux.vnet.ibm.com \
    --cc=zsh-users@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).