From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Assigning an array to a nameref "placeholder"
Date: Mon, 26 Feb 2024 18:51:49 -0800 [thread overview]
Message-ID: <CAH+w=7ZePAx3FfKvOMu28WdiuFHV3oHQSEb3fjj0oiefovL0Vw@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7YPkNSiSC_mp-THHvV-fV_rnbrrhVy6Q00ybeszVPUeyw@mail.gmail.com>
On Mon, Feb 26, 2024 at 2:18 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> Another one from the ksh93u+ gitlab:
>
> > nameref unsetref; unsetref+=(foo bar). This now produces a "removing nameref attribute" warning before performing the assignment.
>
> I would rather make this an error, but it's probably not difficult
> either way. Comments?
Incidentally:
% typeset x
% typeset -p x
typeset x=''
% x+=(a b)
% typeset -p x
typeset -a x=( '' a b )
This has been the case for as long as += has been around, as far as I
can tell. Works this way even with typesettounset, but not if the
parameter was never declared or has been explicitly removed with
"unset".
next prev parent reply other threads:[~2024-02-27 2:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-26 22:18 Bart Schaefer
2024-02-27 2:51 ` Bart Schaefer [this message]
2024-02-27 4:56 ` [PATCH] Appending an array to a scalar Bart Schaefer
2024-02-27 6:48 ` Assigning an array to a nameref "placeholder" Stephane Chazelas
2024-02-28 2:10 ` Bart Schaefer
2024-02-28 5:28 ` Stephane Chazelas
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='CAH+w=7ZePAx3FfKvOMu28WdiuFHV3oHQSEb3fjj0oiefovL0Vw@mail.gmail.com' \
--to=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).