Re: [PATCH] Fix bang flag in ${(!)ref::=var} substitutions
Bart Schaefer <[email protected]> Sun, 19 Jul 2026 14:06:46 -0700
| Newsgroups | gmane.comp.shells.zsh.devel |
|---|---|
| Message-ID | <CAH+w=7ZRs+4LpUNkTzpVgbYHndfNcUPreOicmBS4Z9=0Op=FaA@mail.gmail.com> |
On Fri, Jul 10, 2026 at 5:06=E2=80=AFAM Philippe Altherr <[email protected]> wrote: > > The documentation states that with the substitution flag (!) the referenc= e itself is examined, not its referent, but this fails in ${(!)ref::=3Dvar}= substitutions: I'm unsure what to do with this one. Ksh doesn't have ${x::=3Dy} so there's no direct comparison. With "ref" undeclared or with `typeset -n ref` (placeholder), ${!ref:=3Dvar} ksh always returns "ref" and ignores the assignment. So we're in a bit of uncharted territory here. It's not clear that ::=3D should alter "ref". Is this a precedence issue? I.e., should ${(!)ref::=3Dvar} be equivalent to ${(!)${ref::=3Dvar}} ? (Which is the current behavior, right?)