Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: A solution to fix hidden references in reference chains
- X-seq: zsh-workers 54222
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Philippe Altherr <philippe.altherr@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: A solution to fix hidden references in reference chains
- Date: Sun, 15 Mar 2026 17:04:42 -0700
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=jV12D8ODH4t6ACd/ND365Rcvuh6EIr/I3O8T0mw4AEc=; fh=RngAOd9wlRc8Glv1v2GOfDUnq2FsyrczungEY8JNfXY=; b=ifiMH9HNXgukVkOgPxWlFvWsg3PwU7u5B2TeWb9BikT+pAkZ/+n0WQfvP0ZxEMHepn K731Op4sBaEmHcRq28eWJIKH8UiRBCObfHqnVTMgGntYPTf9PYerqGqOqBTa/4WsF/lO mJwelIYkSoKFV3iRwkt4PI9g+G5iF6qwa71sKZ1XqRU5EJgQN/5yfJugGzv9vbhUcDqE kkloT+TZAi7UE2RLw1Kq2CWh0SyR8ijdSU+RiO4SdrC8jvd8D8mNTlkQ2B+g6nTglXPf OcBFpkerKjm2SLbY+WjXO7Nrwf2URA9dEsLnox9UuBIQuz2x8lgqRJTKcPVhBnsgIT3L R1bw==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1773619494; cv=none; d=google.com; s=arc-20240605; b=ckMoAhV3DTtfCqvOAm9+IzO5MHjRqLDep36qzpnKJksdToclw3mYvz2wbXbeJ+pCDL v5oCweAFdhsHDYEr42Wgqjtz3MSNxCQuG+GATcwmwdsvhzhRhhZ+nQnR1UXjcBW5E+fu ZSJVqqWE8ShysC9IpR3UsYWzc4ic1GfUbY+nDRy3kD7fYYFJdGgGeqNXaaOJvBHsBOCN mwNIdZFiqjG6L5cyQn0rtUrJJH67zomp5VrOe7TfrdNoy9Qmoq740jzyvz42bWZNk1B3 Eg+loXBsSyijSl/4ApVFgwtUKUZ8pC7yKwlCk6M4Ohlk0tmksWMsIiJT/acPx4stCqyF Oy7A==
- Archived-at: <https://zsh.org/workers/54222>
- In-reply-to: <CAH+w=7Y7WcHh6VYUakX42cUc2ybHNPp=q5ex91UUL1HGc1YjMw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAGdYchu3rxH9MBanWDLTuWcaUNh+g1suQD1bRmC+Pbcj+QJY1A@mail.gmail.com> <CAGdYchvU3=Zzk8q-V36EEf9WDHd6Y9Mjgg=mkKFVRn0BbGuAcA@mail.gmail.com> <CAGdYchuNP=3pfWYRX7iq3wqTf1tzwuUA+txdpPiKrLAcATMLdg@mail.gmail.com> <CAGdYchsVb+dSmS6uHVqORNkFdcmY3f9qKz_J9CrLJYuMN6sf0A@mail.gmail.com> <CAH+w=7Y7WcHh6VYUakX42cUc2ybHNPp=q5ex91UUL1HGc1YjMw@mail.gmail.com>
(Sorry, focus glitch caused that to be sent in mid-edit.)
On Tue, Feb 17, 2026 at 1:51 PM Philippe Altherr
<philippe.altherr@xxxxxxxxx> wrote:
>
> Here is an updated patch obtained after rebasing onto the latest head.
Tell me if I'm reading this implementation correctly.
scoperefs is a C array of LinkList pointers. It will always be as
large as the greatest locallevel (deepest nested scope) in which a
nameref has pointed to a nested parameter, during the lifetime of the
shell. Therefore there may be NULL (and/or empty list) elements
scattered throughout scoperefs.
Each element of scoperefs is a linked list of named references (Param
pointers) that need to be re-scoped when that locallevel is exited.
Since a given element of scoperefs can only be referenced on the way
down or back up the call stack, maybe a linked list of linked lists
would be preferable?
In the comments you say
> "Param" instances get reused when variables with
> the same name are redefined in the same scope
That would never apply to a parameter in a surrounding scope (it would
always become the pm->old of the new parameter in the nested scope).
In what circumstances, then, does the base of a given parameter need
to be reset more than once to different values? Does one of the
"Transitive references" tests in K01 cover such a circumstance?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author