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

Re: [PATCH 1/3]: Add named references



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