Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: ::= didn't respect parameter flags
- X-seq: zsh-workers 54740
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: PATCH: ::= didn't respect parameter flags
- Date: Wed, 10 Jun 2026 18:17:41 +0200
- 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=qnYvt/sYia6Ub/2w4P9+7/0NLxE8Sj4AyWfx7keqzSM=; fh=QgfxxE0gysBJ7evxa0WZY5Olv+ibLYueRkqhtBdu00I=; b=XpWsHH3ZwZwza2R0K0N4kim0XzdrIQ7gLgsg7OAsS+WKP97Gck1E2TojrlUOSWKJjc Z99MELHY0yh8/V9HJUdbBp87ap/5URrKIZuY1nLSwlCC2z9T28e0l42k0hLDsfio95Wg +pnOHBzCcW236pUY4ELUvhLC/5fNZAFU9zwx2driPQy19ChZz/VTkPqxcQ9k7rmtzQ9X 4OHkmfx74/OkYpRVEc0khDkxscfPuG2XXfyzAa7ooOyOcgFY4p7suHye+kFqRQ+EKOz8 vP2kem9gdtVp2HwajdngmhTvYiSsDYR/BRDtcndmHuCPDsqhadPGgddgAhpxBe50DYTm kYcg==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1781108275; cv=none; d=google.com; s=arc-20240605; b=HkDYwsbtIeVgtlX3yYgoKRojDnyn8wfydBb000z/owPUo4lUWyNqRdIPcuz8P7ahEx v1NHfxYk5ANTDhLpDfaXgd4Wu93l6YDRgB7J8G7kDum+61SpkVuElrxEOglAu4ITk9IK a7r+QskkTFssJO5Un8FzxNKjgrDH6FGU+tZ6fHrpB63ZGtxB2YLMS16MK5B6QkbUzKHz SV58Rt/eVfGIjSMQcDgCIA4q6AQ5XisEpHgyuAq+f0hJdoavNh2m9W5uRKPXCqlj4AMp dTZa0QpbzL2WwkaKfkfQiGNQ3DfeLmopEMf0Kd33iFsZ2Z6rJkyg8Z63uXFeN9D8T5Z8 yR2g==
- Archived-at: <https://zsh.org/workers/54740>
- In-reply-to: <CAH+w=7b-mukNw+RFBm3fnVT3Bh6+PftpUFEDxzLmf-2szXMfhw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAHYJk3RPgqh54Mky+5ar6_ui7H7mNzzuuxoYhTLRtxLrQE+1yQ@mail.gmail.com> <20260604071557.8072-1-mikachu@gmail.com> <CAH+w=7b-mukNw+RFBm3fnVT3Bh6+PftpUFEDxzLmf-2szXMfhw@mail.gmail.com>
On Wed, Jun 10, 2026 at 6:38 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Thu, Jun 4, 2026 at 12:16 AM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> >
> > We agreed that at least the latter is definitely disagreeing with what you would
> > expect and the documentation.
>
> I meant to reply to this sooner. Does this change in any way impact
> the 25 "Rules" in doc section 14.3.3? Presently that doesn't mention
> assignment forms at all, but there are a number of explicit orderings
> of expansion flags with respect to each other and with respect to
> nested expansions, and I think it could be argued that
> ${(A)uniquearr::=$duplicates} contains a nested expansion. Perhaps
> this at least needs clarification?
Hm, I did come up with a case that you might argue would affect where
the assignment forms should be inserted if they were,
% () { zsh -c $1; zsh-5.9-mika -c $1 } 'bar=lower; BAR=upper; typeset
-u foo=bar; echo $foo ${(P)${foo::=bar}}'
BAR upper
BAR lower
% () { zsh -c $1; zsh-5.9-mika -c $1 } 'bar=lower; BAR=upper; typeset
-u foo=bar; echo $foo ${(PU)${foo::=bar}}'
BAR UPPER
BAR LOWER
while all of these remain the same,
% () { zsh -c $1; zsh-5.9-mika -c $1 } 'bar=lower; BAR=upper; typeset
-u foo=bar; echo $foo ${(P)${(U)foo::=bar}}'
BAR upper
BAR upper
% () { zsh -c $1; zsh-5.9-mika -c $1 } 'bar=lower; BAR=upper; typeset
foo=bar; echo $foo ${(PU)${foo::=bar}}'
bar LOWER
bar LOWER
% () { zsh -c $1; zsh-5.9-mika -c $1 } 'bar=lower; BAR=upper; typeset
foo=bar; echo $foo ${(P)${(U)foo::=bar}}'
bar upper
bar upper
% () { zsh -c $1; zsh-5.9-mika -c $1 } 'bar=lower; BAR=upper; typeset
foo=bar; echo $foo ${(PU)${(U)foo::=bar}}'
bar UPPER
bar UPPER
So the difference is only that parameter flags take effect in the same
place as parameter expansion flags for assignment forms now, which is
what, as mentioned, the documentation for the assignment forms already
said it did.
None of these non-nested forms appear to change,
% () { zsh -c $1; zsh-5.9-mika -c $1 } 'bar=lower; BAR=upper; typeset
foo=bar; echo $foo ${(PU)foo::=bar}'
bar BAR
bar BAR
% () { zsh -c $1; zsh-5.9-mika -c $1 } 'bar=lower; BAR=upper; typeset
foo=bar; echo $foo ${(PU)foo}'
bar LOWER
bar LOWER
% () { zsh -c $1; zsh-5.9-mika -c $1 } 'bar=lower; BAR=upper; typeset
-u foo=bar; echo $foo ${(PU)foo::=bar}'
BAR BAR
BAR BAR
% () { zsh -c $1; zsh-5.9-mika -c $1 } 'bar=lower; BAR=upper; typeset
-u foo=bar; echo $foo ${(PU)foo}'
BAR LOWER
BAR LOWER
If you, or anyone, have a specific change to suggest to the list of
rules, that would be nice.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author