On Thu, Apr 18, 2013 at 11:51 PM, Roland Mainz <[email protected]> wrote:
> While writing an example for typeset -m I found an issue when a
> typeset'ed variable with the attributes -i/-E/-T is moved into a
> compound variable but then looses those attributes.
>
> Example:
> -- snip --
> float y1=2.34
> compound c
> typeset -m 'c.y1=y1'
> float c.y2=2.34
> print -v c
> -- snip --
>
> AFAIK the expected output should look like this...
> -- snip --
> (
>         typeset -l -E y1=2.34
>         typeset -l -E y2=2.34
> )
> -- snip --
> ... but ast-ksh.2013-04-09 on SuSE 12.2/Linux/64bit prints this:
> -- snip --
> (
>         y1=2.34
>         typeset -l -E y2=2.34
> )
> -- snip --
>
>
> The same happens for typeset -M... the example below...
> -- snip --
> typeset -M totitle y1=hello
> compound c
> typeset -m 'c.y1=y1'
> typeset -M totitle c.y2=hello
> print -v c
> -- snip --
> ... should AFAIK print...
> -- snip --
> (
>         typeset -M totitle y1=HELLO
>         typeset -M totitle y2=HELLO
> )
> -- snip --
> ... but ast-ksh.2013-04-09 prints this:
> -- snip --
> (
>         y1=HELLO
>         typeset -M totitle y2=HELLO
> )
> -- snip --

Below is another testcase (testing "bool"/enums and multi-dimensional
arrays vs. "typeset -m") which shows that even enum's loose their type
attributes:
-- snip --
$ ksh -c 'compound -a a=( [40][41][42][43]=( bool v ) ) ; ((
a[40][41][42][43].v=1 )) ;compound -a b ; typeset -m
"b[50][51][52][53].v=a[40][41][42][43].v" ; print -v b '
(
        typeset -a [50]=(
                typeset -a [51]=(
                        typeset -a [52]=(
                                [53]=(
                                        v=true
                                )
                        )
                )
        )
)
-- snip --
(the "v=true"-line should be "_Bool v=true")

----

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

Reply via email to