Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Assigning an array to a nameref "placeholder"
- X-seq: zsh-workers 52618
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Assigning an array to a nameref "placeholder"
- Date: Mon, 26 Feb 2024 18:51:49 -0800
- Archived-at: <https://zsh.org/workers/52618>
- In-reply-to: <CAH+w=7YPkNSiSC_mp-THHvV-fV_rnbrrhVy6Q00ybeszVPUeyw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7YPkNSiSC_mp-THHvV-fV_rnbrrhVy6Q00ybeszVPUeyw@mail.gmail.com>
On Mon, Feb 26, 2024 at 2:18 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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".
Messages sorted by:
Reverse Date,
Date,
Thread,
Author