zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <psprint@zdharma.org>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: 5.3.1-dev-0 difference in array=( "${(PA@)var_name}" )
Date: Thu, 15 Jun 2017 08:03:01 +0200	[thread overview]
Message-ID: <etPan.59422316.79e2a9e3.8fd5@MacMini.local> (raw)
In-Reply-To: <CAH+w=7aGkJpWqM=2QEz_SgFokwNSxfok7WA2v6Uv=Fw6P3Skcg@mail.gmail.com>

On 14-06-2017 at 22:35:51, Bart Schaefer (schaefer@brasslantern.com) wrote:
> On Wed, Jun 14, 2017 at 10:09 AM, Sebastian Gniazdowski
> wrote:
> > Hello,
> > % zsh-5.3.1
> > % var_name="abcdef"; array=( "${(PA@)var_name}" ); echo ${#array}
> > 1
> 
> The (A) flag doesn't mean anything in this context in 5.3.1, that was
> added about 2 months after the 5.3.1 release.

I suspect it was this patch about using A outside ::= context.

> So in the above example ${(P)var_name} returns a scalar and the (@)
> flag is also meaningless. In this next example --

I think @ has an actual effect:

> zsh-5.1.1
> abcdef=( a b ); var_name="abcdef"; array=( "${(PA@)var_name}" ); echo ${#array}
2
> ... array=( "${(P@)var_name}" ); echo ${#array}
2
> ... array=( "${(PA)var_name}" ); echo ${#array}
1
> ... array=( "${(P)var_name}" ); echo ${#array}
1

> resolve to nothing rather than to a quoted empty string, just as
> "${emptyarray[@]}" would do.

Yes it's a change for the better.

--
Sebastian Gniazdowski
psprint /at/ zdharma.org


  reply	other threads:[~2017-06-15  6:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14 17:09 Sebastian Gniazdowski
2017-06-14 20:35 ` Bart Schaefer
2017-06-15  6:03   ` Sebastian Gniazdowski [this message]
2017-06-15  6:10     ` 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=etPan.59422316.79e2a9e3.8fd5@MacMini.local \
    --to=psprint@zdharma.org \
    --cc=schaefer@brasslantern.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).