This is cool! Will it eventually be possible to make it type-aware, or to
allow passing references? Or is it just fundamentally only usable with
strings?
#!/usr/bin/env ksh
typeset -T Test_t=(
typeset attr=success!
)
function f {
case $1 in
0)
compound myTests=(
typeset x=${ f 1; }
typeset y
)
f 2 myTests.y
print -r "x: ${myTests.x.attr-fail :(}"
print -r "y: ${myTests.y.attr-fail :(}"
;;
1)
# Try returning an object through .sh.value
Test_t .sh.value
;;
2)
# The usual method by reference.
nameref x=$2
Test_t x
esac
}
# x: fail :(
# y: success!
f 0
--
Dan Douglas
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users