Wendy Lin
2013-07-23 13:03:26 UTC
I found another bug in print -v with arrays:
ksh -c 'bool -a bl;for((i=0;i<10;i++));do
bl[2][i]=true;((i%3))&&bl[3][i]=true;done;print -v bl'
(
[2]=(
true
true
true
true
true
true
true
true
true
true
)
typeset -a [3]=(
[1]=true
[2]=true
[4]=true
[5]=true
[7]=true
[8]=true
)
)
As you'll notice the 2nd index is represented in two different forms:
First [2]=( and the 2nd typeset -a [3]. IMO the typeset -a is
redundant and screws up our parsing attempts from C++ side.
Wendy
ksh -c 'bool -a bl;for((i=0;i<10;i++));do
bl[2][i]=true;((i%3))&&bl[3][i]=true;done;print -v bl'
(
[2]=(
true
true
true
true
true
true
true
true
true
true
)
typeset -a [3]=(
[1]=true
[2]=true
[4]=true
[5]=true
[7]=true
[8]=true
)
)
As you'll notice the 2nd index is represented in two different forms:
First [2]=( and the 2nd typeset -a [3]. IMO the typeset -a is
redundant and screws up our parsing attempts from C++ side.
Wendy