On 16 August 2013 10:18, Cedric Blancher <[email protected]> wrote:
> On 16 August 2013 07:18, Roland Mainz <[email protected]> wrote:
>> On Fri, Aug 16, 2013 at 6:42 AM, Roland Mainz <[email protected]>
>> wrote:
>>> On Fri, Aug 16, 2013 at 12:45 AM, David Korn <[email protected]> wrote:
>>>> cc: [email protected]
>>>> Subject: Re: Re: [ast-developers] AT&T Software Technology ast alpha
>>>> software download update
>>>> --------
>>>>
>>>>> ksh tst1.sh
>>>>> tst1.sh: line 3: .sh.type.com.gelifesciences.tst1: no parent
>>>>>
>>>>> Irek
>>>>
>>>> Try this patch and see if it fixed the types problem in namespaces.
>>>> =====================cut here======================
>>>> --- old/sh/xec.c Mon Aug 12 13:22:06 2013
>>>> +++ new/sh/xec.c Thu Aug 15 18:01:37 2013
>>> [snip]
>>>> =====================cut here======================
>>>
>>> The patch seems to fix half the problems. The types can now be defined
>>> but a variable declared with such a type can't find it's type
>>> functions:
>>> -- snip --
>>> $ ksh -o nounset -c 'namespace a.b.c { typeset -T x_t=( integer i=5 )
>>> ; function pi { printf "i=%d\n" $((_.i+_.i)) ; } ; } ; .a.b.c.x_t var
>>> ; var.pi'
>>> /bin/ksh: var.pi: not found
>>> -- snip --
>>> AFAIK this should print "10" ...
>>
>> ... and it does... if I would've put the ')' at the right place:
>> -- snip --
>> $ ksh -o nounset -c 'namespace a.b.c { typeset -T x_t=( integer i=5 ;
>> function pi { printf "i=%d\n" $((_.i+_.i)) ; } ) ; } ; .a.b.c.x_t var
>> ; var.pi'
>> i=10
>> -- snip --
>>
>> Sorry for the mess... |ENOCOFFEE| ... ;-(
>> ... the patch works... thanks... :-)
>>
>
> Arithmetic expressions still don't work in namespaces:
> ksh -c 'namespace a1.a2 { integer n=2 ; print $((i+i)) ; }'
> 0
>
> It should print '4'.
Copying .sh.sig data in a namespace doesn't work either:
namespace a.b
{
compound c
compound -a c.car
integer c.cari=0
trap 'c.car[$((c.cari++))]=.sh.sig' USR1 USR2 RTMIN
kill -q4 -s USR1 $$
kill -q17 -s USR2 $$
print -v c
}
This prints:
ksh x.sh
x.sh: line 9: .sh.sig.value.ptr: is read only
x.sh: line 10: .sh.sig.value.ptr: is read only
(
typeset -C -a car=(
[0]=(
typeset -C value
)
[1]=(
typeset -C value
)
)
typeset -l -i cari=2
)
This is dead wrong. It should print the copied siginfo (.sh.sig) data.
Ced
--
Cedric Blancher <[email protected]>
Institute Pasteur
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers