zsh-workers
 help / color / mirror / code / Atom feed
From: Anders Kaseorg <andersk@mit.edu>
To: zsh-workers@zsh.org
Subject: Array expansion interacts with brace expansion in the wrong order
Date: Thu, 13 Jul 2017 18:45:09 -0400 (EDT)	[thread overview]
Message-ID: <alpine.DEB.2.10.1707131831290.28302@mass-toolpike.mit.edu> (raw)

Given a=(1 2 3), I would expect {$^a,4,5,6} to expand to 1 2 3 4 5 6, but 
it doesn’t.  Instead the 4 5 6 is duplicated for every element of $^a:

% echo $ZSH_PATCHLEVEL
zsh-5.3.1-240-ga3b3f0057
% echo {{1,2,3},4,5,6}
1 2 3 4 5 6
% a=(1 2 3)
% echo {$^a,4,5,6}
1 4 5 6 2 4 5 6 3 4 5 6

Anders


             reply	other threads:[~2017-07-13 22:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13 22:45 Anders Kaseorg [this message]
2017-07-13 23:48 ` Bart Schaefer
2017-07-14  1:42   ` Anders Kaseorg
2017-07-14  8:48     ` Peter Stephenson
2017-07-14  9:45       ` Peter Stephenson
2017-07-15 17:19         ` Peter Stephenson

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=alpine.DEB.2.10.1707131831290.28302@mass-toolpike.mit.edu \
    --to=andersk@mit.edu \
    --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).