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

Re: PATCH: Fix nameref errors exposed by Philippe's tests



I have applied your patch on top of zsh HEAD and things look much better with it. Results for nr-test "" {0..12} now all make sense. Same for nr-test -u {0..4} but I don't understand why the results for nr-test -u {5..10} keep referring to "g". I expected nr-test -u {5,6,10} to initially refer to "h" and nr-test -u {7,8,9} to initially refer to "i".

I'm still working on my two posts. I'll base them on "zsh HEAD + your patch" rather than zsh-5.9.0.2-test as the former seems to be much closer to the intended design than the latter.

Philippe


On Mon, May 5, 2025 at 5:11 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
On Sun, May 4, 2025 at 10:18 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> % zsh-5.9.0.2-test nr-test.zsh "" 7
> g:1: rs= - ra= - rs1= - ra1=
> g:2: rs= - ra= - rs1= - ra1=
> h:1: rs= - ra= - rs1= - ra1=
> h:2: rs= - ra= - rs1= - ra1=
> i:1: rs= - ra= - rs1= - ra1=
> i:2: rs= - ra= - rs1= - ra1=
> VALUES 7

I had inserted some extra print statements so I could see in the
output where the assignment took place.  Copy-pasted from that output
instead of the original script.

> j:1: rs=i - ra=i - rs1=i - ra1=i
> j:2: rs=i - ra=i - rs1=i - ra1=i
> k:1: rs=i - ra=i - rs1=i - ra1=i
> j:3: rs=i - ra=i - rs1=i - ra1=i
> i:3: rs=i - ra=i - rs1=i - ra1=i
> h:3: rs=h - ra=h - rs1=h - ra1=h
> g:3: rs=g - ra=g - rs1=g - ra1=g

As mentioned on one of the other threads, I now think these last two
lines are (and should be) the expected behavior.

My intention is to reduce this test script to less extensive examples
and add them to K01nameref.  The cases it exposed don't need seven
scopes to come to light.



Messages sorted by: Reverse Date, Date, Thread, Author