Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Assigning an array to a nameref "placeholder"



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