Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Assigning an array to a nameref "placeholder"
- X-seq: zsh-workers 52628
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Assigning an array to a nameref "placeholder"
- Date: Tue, 27 Feb 2024 18:10:44 -0800
- Archived-at: <https://zsh.org/workers/52628>
- In-reply-to: <20240227064807.xa77q6qjek77nekq@chazelas.org>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7YPkNSiSC_mp-THHvV-fV_rnbrrhVy6Q00ybeszVPUeyw@mail.gmail.com> <20240227064807.xa77q6qjek77nekq@chazelas.org>
On Mon, Feb 26, 2024 at 10:48 PM Stephane Chazelas
<stephane@xxxxxxxxxxxx> wrote:
>
> 2024-02-26 14:18:03 -0800, Bart Schaefer:
> >
> > > 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?
>
> An error (or forbidding typeset -n ref=var without the =var part
> like in mksh) would make a lot more sense to me as well.
Forbidding "typeset -n ref" would make using the "for" loop variation
a bit weird, but I'm perfectly fine with an error on assigning
something nonsensical to a nameref.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author