Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH 1/3]: Add named references
- X-seq: zsh-workers 51384
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH 1/3]: Add named references
- Date: Wed, 8 Feb 2023 15:16:46 -0800
- Archived-at: <https://zsh.org/workers/51384>
- In-reply-to: <CAH+w=7ZFq_MyNtPVetDt84Zp8dnCQXis3p=2sKP018GZ-VTd0g@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7bd5tHQ8_ZFuyheUrTStm8pR826jH1LB-vMdEnv14nH0w@mail.gmail.com> <67689-1675827940.088548@BxvG.D9_b.7RzI> <CAH+w=7ZFq_MyNtPVetDt84Zp8dnCQXis3p=2sKP018GZ-VTd0g@mail.gmail.com>
On Tue, Feb 7, 2023 at 8:59 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Tue, Feb 7, 2023 at 7:45 PM Oliver Kiddle <opk@xxxxxxx> wrote:
> >
> > The error message from, e.g. `typeset -Z2 ref` is "can't change type
> > of a named reference".
>
> Hmm, yes, that message should be changed if possible.
It'd be more effort than it's worth to distinguish the type of array
involved, but my next patch will change this to say "of array
element".
> if the current locallevel were visible (cf. new special) then something like
> typeset -i $((locallevel-1)) -n up=argv
> could work. I think the current implementation of argv breaks this, tho.
The up-level argv is a char ** scoped to doshfunc() so it'd be rather
icky to expose it as a shell parameter.
> The special behavior of namerefs in "for" loops and implementing
> "unset -n" might be good; the latter isn't mentioned until the "unset"
> builtin in the ksh93 doc so I missed it entirely.
Next patch will have both of these, too. I note that execfor() has
quite a bit of room for optimization, but I haven't dived into that.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author