Hi!
----
While playing around with ast-ksh.2013-02-14 I hit an issue when I
tried to read the output of print -v c via read -C when the input
nests user-defined types via an array.
Example:
-- snip --
$ ~/bin/ksh -c 'typeset -T x_t=( compound -A bar ) ; compound c=( x_t
d ) ; x_t c.d.bar[4].b ; print -v c >xxx ; read -C p <xxx ; print -v
p'
/home/test001/bin/ksh: read[6]: typeset: p.d.bar: is not an element of p.d
-- snip --
After some digging I looked at the contents of the file "xxx":
-- snip --
$ cat xxx
(
x_t d=(
typeset -C -A bar=(
[4]=(
x_t b=(
typeset -C -A bar
)
)
)
)
)
-- snip --
This looks Ok so far...
... but if I turn it into a script (with the user-defined type
definition for type "x_t" at the front) it still prints an error:
-- snip --
$ cat yyy.sh
typeset -T x_t=( compound -A bar )
compound p=(
x_t d=(
typeset -C -A bar=(
[4]=(
x_t b=(
typeset -C -A bar
)
)
)
)
)
$ ~/bin/ksh yyy.sh
~/bin/ksh yyy
yyy.sh[7]: typeset: p.d.bar: is not an element of p.d
-- snip --
... so this is the same error...
... but replacing the inner usage of "x_t" by a plain "compound"
causes the warning to disappear (difference to the previous script is
("sed"-style) "s/x_t b/compound b/"):
-- snip --
$ cat yyy.sh
typeset -T x_t=( compound -A bar )
compound p=(
x_t d=(
typeset -C -A bar=(
[4]=(
compound b=(
typeset -C -A bar
)
)
)
)
)
$ ~/bin/ksh yyy.sh
# no output here
-- snip --
Uhm... question for David: This is a bug (related to nesting a
user-defined type), right ?
----
Bye,
Roland
--
__ . . __
(o.\ \/ /.o) [email protected]
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers