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

New typeset is a bit too verbose, and skips some assignments



torch% typeset x=()
torch% typeset x=() x[2]=a x[4]=b
x=()
torch% typeset -p x
typeset -a x
x=('' a '' b)
torch% 

The value of x should not have been displayed by the second typeset in
that example, because all the names have assignments.  It also looks
wrong, because it's the value from before the assignments to elements.

This only happens if the type is array before the new assignment, but
the initial empty assignment doesn't have any effect:

torch% typeset y   
torch% typeset y=() y[2]=a y[4]=b
torch% typeset y=() y[1]=x y[3]=z
y=('' a '' b)
torch% typeset -p y
y=(x a z b)
torch% 

I expected y=(x '' z '').



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