cc: [email protected]
Subject: Re: [ast-users] ".get" and ".set" discipline functions not working for
compound variables...
--------
> Hi!
>
> ----
>
> It looks the ".get" and ".set" discipline functions are not working for
> compound variables in ast-ksh.2009-06-22.
>
> Example for ".get" discipline:
> -- snip --
> $ ksh93 -c 'compound c; function c.get { .sh.value=( i=1 ) ; } ; print
> -v c'
> -- snip --
> this currently prints:
> -- snip --
> (
> )
> -- snip --
> ... but AFAIK should print:
> -- snip --
> (
> i=1
> )
> -- snip --
The variable .sh.value is a string, not a compound variable, If you do
.sh.value=$'(\ni=1\n)'
it will give the result you want. A typical use would be
foo.get()
{
.sh.value="${foo.x}+i*${foo.y}"
}
to output a complex variable implemented as a compound variable.
>
> Example for the ".set" discipline:
> -- snip --
> $ ksh93 -c 'compound c; function c.set { print -v ".sh.value" ; } ; c=(
> hello=1 ) '
> -- snip --
>
> This should print:
> -- snip --
> (
> hello=1
> )
> -- snip --
> ... but currently prints nothing... ;-(
>
> ----
>
> Bye,
> Roland
>
Since the assignment is equivalent to c.hello=1, there is no assignment to
c, it currently prints nothing. I will look into changing this in
a future release.
David Korn
[email protected]
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users