To: [email protected]
Subject: Re: [ast-users] Some more ksh93 oddities
--------

> 1)
> typeset -T oset=(
>     typeset -A s
> 
>     function add {
>         nameref var=${.sh.name}
>         typeset elem
>         for elem; do
>             : ${var.s[$elem]:=0}
>         done
>     }
> )
> oset foo bar
> foo.add a b
> bar.add d e
> print "${foo.s[*]} : ${!foo.s[*]} \n${bar.s[*]} : ${!bar.s[*]}"
> 
> gives:
> 0 0 0 0 : a b d e
> 0 0 0 0 : a b d e
> 
> as though s is being shared.
Fixed in ksh93u.
> 
> 2)
> typeset -T olist=(
>     typeset -a l
> )
> olist foo
> foo.l[1]=x
> print "${!foo.l[*]}"
> 
> gives:
> 0 1
> (A spurious '0' index is created)
Fixed in ksh93u.
> 
> 3)
> typeset -T oset=( typeset -A foo )
> oset bar
> bar.foo=( [a]=b [c]=d )
> print ${!bar[*]}
This is not a bug.  bar is a compound variable, not an array.
> 
> gives:
> 0
> 
> 4)
> (typeset -T foo=( integer i ) )
> typeset -T foo=( integer i )
> 
> gives:
> typeset: foo: type cannot be redefined
> despite the first typeset nominally being done in a subshell.
Fixed in ksh93u.
> 
>       John
> -- 
> John DuBois   [email protected]   KC6QKZ/AE

David Korn
[email protected]
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to