* Is ${#array} supposed to work with ksharrays?
@ 2001-03-23 6:40 Bart Schaefer
2001-03-23 7:07 ` Bart Schaefer
0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2001-03-23 6:40 UTC (permalink / raw)
To: zsh-workers
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Is ${#array} supposed to work with ksharrays?
@ 2001-03-23 8:23 Sven Wischnowsky
0 siblings, 0 replies; 3+ messages in thread
From: Sven Wischnowsky @ 2001-03-23 8:23 UTC (permalink / raw)
To: zsh-workers
Bart Schaefer wrote:
> On Mar 23, 6:40am, Bart Schaefer wrote:
> } Subject: Is ${#array} supposed to work with ksharrays?
> }
> } It appears that ${#array} always returns 1 when ksharrays is set.
>
> After a moment's thought, I tried ${#array[@]}, which of course gives
> the correct result ... but the original question remains ...
It's the same the ksh here does...
Bye
Sven
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-03-23 8:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-23 6:40 Is ${#array} supposed to work with ksharrays? Bart Schaefer
2001-03-23 7:07 ` Bart Schaefer
2001-03-23 8:23 Sven Wischnowsky
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).