Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH 1/3]: Add named references
- X-seq: zsh-workers 51401
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH 1/3]: Add named references
- Date: Sat, 11 Feb 2023 15:45:14 -0800
- Archived-at: <https://zsh.org/workers/51401>
- In-reply-to: <CAH+w=7YN_i9KxgZFFn1zNe98pT0KmErdpHNZr_oAWf5CpwsgSg@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> <12608-1675903622.800470@Xj82.e3y1.svhG> <CAH+w=7ZZUCqYe6w1ZqZZKR6iLsZH0SDDXyzwgTU93nxx6bmxjQ@mail.gmail.com> <66045-1675975796.128039@FBF_.0yMO.Y8fk> <CAH+w=7bcqc8SsRxsht0QFyXy=DYzj6nVaBFhdzQ5MrBB+yBz+A@mail.gmail.com> <CAH+w=7YVJO-HkneMpnfBbqBztPaXdXTD=mo-vHbdUW00TiFVBQ@mail.gmail.com> <40726-1676098925.110777@U2kb.d0Pd.I9ml> <CAH+w=7aKwKhdXjPo2FQG1GqjHQzX=5to_m6kZeL-UFfQh_XMtw@mail.gmail.com> <CAH+w=7YN_i9KxgZFFn1zNe98pT0KmErdpHNZr_oAWf5CpwsgSg@mail.gmail.com>
On Sat, Feb 11, 2023 at 3:43 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Fri, Feb 10, 2023 at 11:45 PM Bart Schaefer
> <schaefer@xxxxxxxxxxxxxxxx> wrote:
> >
> > On Fri, Feb 10, 2023 at 11:02 PM Oliver Kiddle <opk@xxxxxxx> wrote:
> > >
> > > fine with the reference becoming unset at the time of the return if it
> > > refers to a variable that is going out of scope.
>
> That's actually a little startling given dynamic scoping. It leads to this:
>
> {
> typeset -n ref=var
> () {
> var=FUNC1
# that should of course be "local var=FUNC1" sorry
> typeset -p ref
> }
> typeset -p ref
> }
>
> Output:
> typeset -g -n ref=var
> typeset: no such variable: ref
Messages sorted by:
Reverse Date,
Date,
Thread,
Author