Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
New typeset is a bit too verbose, and skips some assignments
- X-seq: zsh-workers 35608
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: New typeset is a bit too verbose, and skips some assignments
- Date: Thu, 25 Jun 2015 09:21:31 -0700
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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