help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Bug (?) with ${(M)NAME:+WORD} and ${(P)NAME}
Date: Mon, 23 Jan 2023 12:45:07 -0800	[thread overview]
Message-ID: <CAH+w=7bPY30U5Gjmk8_GjPBSkABA9OStAebWorP2y-rXPb0oBQ@mail.gmail.com> (raw)

This works:

() {
  local foo
  () {
    print ${(Mt)foo:#*local*}
    print ${${(Mt)foo:#*local*}:+LOCAL}

This does not:

() {
  local foo
  () {
    print ${(MtP)1:#*local*}
    print ${${(MtP)1:#*local*}:+LOCAL}
  } foo

No alternate nesting of (M) and (P) gives the expected result from :+

The (t) there is not the issue, the same thing happens with:

() {
  local foo=xx-local-xx
  () {
    print ${(MP)1:#*local*}
    print ${${(MP)1:#*local*}:+LOCAL}
  } foo

Am I missing something?

             reply	other threads:[~2023-01-23 20:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23 20:45 Bart Schaefer [this message]
2023-01-24  9:41 ` Mikael Magnusson

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7bPY30U5Gjmk8_GjPBSkABA9OStAebWorP2y-rXPb0oBQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \


* 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


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).