Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Is ${#array} supposed to work with ksharrays?
- X-seq: zsh-workers 13720
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Is ${#array} supposed to work with ksharrays?
- Date: Fri, 23 Mar 2001 06:40:42 +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Try these two functions in 4.0.1-pre-2:
right() {
setopt noksharrays
local -a array
repeat 10 array[$#array+1]=x
print -l $array
}
wrong() {
setopt ksharrays
local -a array
repeat 10 array[${#array}]=x
print -l $array
}
It appears that ${#array} always returns 1 when ksharrays is set. Should it?
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author