Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Fix bang flag in ${(!)ref::=var} substitutions
- X-seq: zsh-workers 54998
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Philippe Altherr <philippe.altherr@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] Fix bang flag in ${(!)ref::=var} substitutions
- Date: Sun, 19 Jul 2026 14:06:46 -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-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=0PXKzMAEE+S8tVqFy01qvaEYC/znpaLEx3jOWHFD5bw=; fh=RngAOd9wlRc8Glv1v2GOfDUnq2FsyrczungEY8JNfXY=; b=TVjQVUbw2Jhrx7z0Sf1stEZyUnEoV3DcKhkPCp2RB2XmXKW6gmS7RKCo/qnTG/dDKi 5yJiXhDdk5L9Q6w8oYdhY4FQG08VUXEzj2/RxTAT3HMmzD7Am0ybtZtf17Y0trICohN9 /qbMumrOx8zm6yCcE1md8ivMu5buxOB5R1Ir4a18/+2xDZ9f9M9xRpgLFaVpNnOu+sDT hiTI8UsOLq0mQGgQBwGgOQILAI32TUOIXoP2hJmIWZoyohCPDR//or9+jHsESKzgOnGh foS+EPSPJszRJC/04wCszGisNwsN6cmuvk6u4GdaWD5esJt5Gkp5+C9TdrvFg6Dum8wz W/jQ==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1784495218; cv=none; d=google.com; s=arc-20260327; b=ga/Ag7utlKs52oXijRy5I58XaDM+dKSkefnzoMqdCGFWaYLIp/juDjnfyepBJK/Gn7 sWpWdJVaccUC9jypPM8ojg0poKFgPGSwqROAKsOdMeCvtmE3ZKXwlfPrM9icr9BfYfEh kj9KTdvXNQxd4Z3kmhYY1l1QeRfhXpx0drU2v8hPqPgbGusDlktn96rsizQCVFSvEKaM qbpiD1Sv9nVB3VAtsnWIBCFtA6FYAjB/8zjlyE2pi3NrgoAPLEPMbzCwX01A+YAA5ZwB VAdxacsjB6oPprSkiQaxgBOqDEAHwY9MBYoYFJ4WniYDEGNAabJdACaqPiRwgFOhdeW6 wSTQ==
- Archived-at: <https://zsh.org/workers/54998>
- In-reply-to: <CAGdYchtt-6ybEWH0q70maUO2D3ZfieNdVN_68-F2MVohjdk77Q@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAGdYchtt-6ybEWH0q70maUO2D3ZfieNdVN_68-F2MVohjdk77Q@mail.gmail.com>
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