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

Re: empty element in 'structure'.



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




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