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

Re: [PATCH] Fix bang flag in ${(!)ref::=var} substitutions



On Fri, Jul 10, 2026 at 5:06 AM Philippe Altherr
<philippe.altherr@xxxxxxxxx> wrote:
>
> The documentation states that with the substitution flag (!) the reference itself is examined, not its referent, but this fails in ${(!)ref::=var} substitutions:

I'm unsure what to do with this one.

Ksh doesn't have ${x::=y} so there's no direct comparison.

With "ref" undeclared or with `typeset -n ref` (placeholder),
${!ref:=var} ksh always returns "ref" and ignores the assignment.

So we're in a bit of uncharted territory here.  It's not clear that
::= should alter "ref".

Is this a precedence issue?  I.e., should ${(!)ref::=var} be
equivalent to ${(!)${ref::=var}} ?  (Which is the current behavior,
right?)




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