zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: PATCH and more remarks on parameter expansion docs
Date: Thu, 03 Jan 2013 11:42:17 -0800	[thread overview]
Message-ID: <130103114217.ZM6362@torch.brasslantern.com> (raw)
In-Reply-To: <20130102232813.GG2054@localhost.localdomain>

On Jan 3,  7:28am, Han Pingtian wrote:
} Subject: Re: PATCH and more remarks on parameter expansion docs
}
} On Wed, Jan 02, 2013 at 08:46:44AM -0800, Bart Schaefer wrote:
} > 
} >      Note that splitting is applied to WORD in the assignment forms of
} >      SPEC _before_ the assignment to NAME is performed.  This affects
} >      the result of array assignments with the A flag.
} 
} I think it doesn't say this splitting _before_ assignments is only true
} when (A) is used. Looks like if (A) wasn't used, splitting will _after_
} the assignments

Ah, I see.  OK, I agree that it's imprecise about this.  It's imprecise
but not in the way that you think:  The splitting is in fact done before
the assignment in either case, but at that point the internals have both
the expanded string and the split result available.  The (A) flag then
determines which of those two values is used in the assignment.

I'm not sure whether in practice this can ever have a visible effect.  In
theory if there were some oddity with the syntax of WORD that caused the
splitting step to fail, then the NAME parameter would not be assigned,
but I can't trivially produce an example.

On the other hand, when does this "mistake" in the documentation matter?
Given what it says, what did you expect ${=xx::=foo   bar} to assign?

The doc needs to strike a balance between giving so much detail that it's
confusing and too little to tell the user what to expect.


  reply	other threads:[~2013-01-03 19:42 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
2013-01-02 16:46         ` Bart Schaefer
2013-01-02 23:28           ` Han Pingtian
2013-01-03 19:42             ` Bart Schaefer [this message]
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=130103114217.ZM6362@torch.brasslantern.com \
    --to=schaefer@brasslantern.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).