zsh-workers
 help / color / mirror / code / Atom feed
From: Dima Kogan <dima@secretsauce.net>
To: zsh-workers <zsh-workers@zsh.org>
Subject: Odd expansion behavior
Date: Thu, 03 Jul 2014 00:43:23 -0700	[thread overview]
Message-ID: <87pphm51lw.fsf@secretsauce.net> (raw)

Hi.

I'm observing something odd. It might be a bug, but I don't understand
it well-enough to call it that.

I see this:

$ x=(1 2 3); echo xxx${^x}
xxx1 xxx2 xxx3

This output makes sense. However something slightly different is strange:

$ x=(1 2 3); y=xxx${^x}; echo $y
xxx1 2 3

Here the ${^x} form turns on the RC_EXPAND_PARAM option, and it's
apparently not kicking in in the second (broken) case. Even if I setopt
it, I still don't have this working.

I asked on #zsh and osse helpfully pointed out that this can be made to
work by expressing the assignment as 'y=(xxx${^x})' instead, which does
work.

But shouldn't it work the other way as well? osse wasn't sure why the
original form wasn't working, so I'm reporting it here as a maybe-bug.

Thanks

dima


             reply	other threads:[~2014-07-03  7:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-03  7:43 Dima Kogan [this message]
2014-07-03  9:12 ` Peter Stephenson
2014-07-03 12:28   ` 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=87pphm51lw.fsf@secretsauce.net \
    --to=dima@secretsauce.net \
    --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).