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'.

That's IMO the biggest limitation of the new namespace system. Its
getting hard to use them in any practical application if arithmetics
with variables don't work.

Tina
-- 
Tina Harriott  - Women in Mathematics
Contact: [email protected]
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to