Re: empty element in 'structure'.

Dominik Vogt <[email protected]> Thu, 14 May 2026 19:38:27 +0100
Newsgroups gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user
Message-ID <agYWoxE2BI9XpAep@localhost>
On Thu, May 14, 2026 at 08:48:07AM -0700, Ray Andrews wrote:
> ... it doesn't work, the 'structure' fails cuz the 'element' vanishes --=
 I
> think.

No. it just has an empty value.

This works fine:

  set -A x
  x[a]=3D"foo"
  x[b]=3D
  x[c]=3Dbar
  set -A y "${(@kv)x}"
  echo "x: ${(@kvq)x}"
  x: a foo b '' c bar
  echo "y: ${(@kvq)y}"
  y: a foo b '' c bar
 =20
> =A0Bclicks=3D()
> =A0body[mouse_clicks]=3D"Bclicks"
>=20
> ... it works fine.=A0 But if I cut to the chase and do:
>=20
> =A0 body[mouse_clicks]=3D"()"

You can't use an array as a value in an associative array if
that's what you were trying to do.  The above just sets the
element "mouse_clicks" to the literal string "Bclick" or "()".

Some of your code seems to be unable to deal with empty strings,
possibly because of a missing "q" flag when expanding array
elements?

Ciao

Dominik ^_^  ^_^

=2D-=20

Dominik Vogt