Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: All the way up or current scope
- X-seq: zsh-workers 53594
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Philippe Altherr <philippe.altherr@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: All the way up or current scope
- Date: Mon, 12 May 2025 14:12:20 -0700
- Archived-at: <https://zsh.org/workers/53594>
- In-reply-to: <CAGdYchsm6=NiahMZj1W7KWDnLbeBQv7WW_y--+3E8g4T1jSagA@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAGdYchv84+isv2Y5B+WJtfz7cGtX-L7br+ZUgqshZC2Tc1OoOA@mail.gmail.com> <CAH+w=7aZjPT6xr5uEUL_s1PmuRh9hjZKZ=YvCuCJyE6Ye9iurw@mail.gmail.com> <CAGdYchswJc0CrMm2dbhFRgu6F=8wRiWnjNff0FhqYacDH_KJLA@mail.gmail.com> <CAGdYchsS2_QuHWuSWU1661K5Z8JY4k0p_QAYygdPRu8-Dr3jUA@mail.gmail.com> <CAH+w=7amjvo42qqO-b3+4_bcKo4VJodJEzZe9EYih3Mmo8gLUg@mail.gmail.com> <CAGdYchuEL6cs=ACG08txwYP+4BJ_gFZp6hFyTq3K+dbbaPfVfA@mail.gmail.com> <CAH+w=7ZiwkMEQfdK=dpDMzPf9yy0yEZbUQ0J=EyUYVGk_tBJ1A@mail.gmail.com> <CAGdYchsm6=NiahMZj1W7KWDnLbeBQv7WW_y--+3E8g4T1jSagA@mail.gmail.com>
On Mon, May 12, 2025 at 9:19 AM Philippe Altherr
<philippe.altherr@xxxxxxxxx> wrote:
>
>> That's not how it currently works. A parameter in the current scope
>> would be found only if the reference were first defined in a nested
>> scope to name a parameter that also existed in a (shallower) nested
>> scope, after which both of those nested scopes return.
>
> That's not true, currently (@1706805d4) a parameter in the local scope is also found even if there are no calls to nested scopes:
>
> () {
> # scope with no parameters
> () {
> local -nu upref=$1
> local var=at_upref
> print -- $upref
> } var
> }
Hm, that crept in during the recent round of changes. It doesn't
behave that way in 5.0.9-test-2.
More later.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author