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

Re: All the way up or current scope



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