Hi!

----

The following examples show that typeset -c in ast-ksh.2013-05-24
doesn't preserve the variable attributes when copying basic
(non-compound/non-array) types:
1. float:
-- snip --
$ ksh -c 'float i=9.8 ; typeset -c j=i ; typeset -p j i ; '
j=9.8
typeset -l -E i=9.8
-- snip --
... expected output would be...
-- snip --
$ ksh -c 'float i=9.8 ; typeset -c j=i ; typeset -p j i ; '
typeset -l -E j=9.8
typeset -l -E i=9.8
-- snip --

2. typeset -M (on Linux/glibc):
-- snip --
$ ksh -c 'typeset -M totitle i="hello" ; typeset -c j=i ; typeset -p j i ; '
j=HELLO
typeset -M totitle i=HELLO
-- snip --
... expected output would be...
-- snip --
$ ksh -c 'typeset -M totitle i="hello" ; typeset -c j=i ; typeset -p j i ; '
typeset -M totitle j=HELLO
typeset -M totitle i=HELLO
-- snip --

3. bool type/enum:
-- snip --
$ ksh -c 'bool i=true ; typeset -c j=i ; typeset -p j i ; '
j=true
_Bool i=true
-- snip --
... expected output would be...
-- snip --
_Bool j=true
_Bool i=true
-- snip --

Notes:
- wrapping these basic types in a compound variable fixes the problems
- IMO (from looking at the code) I think that fixing these will fix
the majority of issues with typeset -c, too

----

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