Hi!

----

The following testcase should merge the compound variable values in
array "b" into the compound variables in array "a":
-- snip --
compound x

compound -a x.a=( [1]=( aa=1 ) [2]=( bb=2 ) [3]=( cc=3 )  )
compound -a x.b=( [1]=( dd=1 ) [2]=( ee=2 ) [3]=( ff=3 )  )

for i in ${!x...@]} ; do
        x.a[$i]+=x.b[$i]
done

print -v x.a
-- snip --

... but somehow this does not work and prints (for ast-ksh.2009-05-05
and ast-ksh.2009-06-26):
-- snip --
(
        [1]='x.b[1]'
        [2]='x.b[2]'
        [3]='x.b[3]'
)
-- snip --
(this is a bit suprising since 'x.b[1]' isn't a valid compound variable
value (IMO the shell should print an error if someone tries to do a $
compound x ; x+="hello world" # (e.g. where it's clear that the string
is neither a valid compound variable or valid compound variable value)))

AFAIK the expected output would be:
-- snip --
(
        [1]=(
            aa=1
            dd=1
        )
        [2]=(
            bb=2
            ee=2
        )
        [3]=(
            cc=3
            ff=3
        )
)
-- snip --

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [email protected]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to