Re: empty element in 'structure'.

Dominik Vogt <[email protected]>
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]="foo"
  x[b]=
  x[c]=bar
  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
  
>  Bclicks=()
>  body[mouse_clicks]="Bclicks"
> 
> ... it works fine.  But if I cut to the chase and do:
> 
>   body[mouse_clicks]="()"

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 ^_^  ^_^

-- 

Dominik Vogt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.