Ralf Hemmecke wrote:
> 
> > I took a quick look for other suspicious cases of ). in the boot code.
> > I found this one:
> >
> > +411 src/interp/category.boot
> >
> >        PrinAncb:= first(b).(4)
> >
> > This is probably correct but it seems crazy to write it this way if
> > you really mean
> >
> >        PrinAncb:= first(b.4)
> >
> > Sometimes you really have to wonder what they were smoking back in the
> > lab ... ;)
> 
> Interesting
> 
> PrinAncb:= first(b).(4)
> 
> gives
> 
> with bootsys
>    (SETQ |PrinAncb| (CAR (ELT (|CatEval| |bname|) 4)))
> 
> with depsys
>   (SPADLET |PrinAncb| (CAR (ELT (|CatEval| |bname|) 4)))
> 
> Why is it basically the same here and makes a difference for "CAR(d).1".
> I'm a bit confused now.
> 

Well, with depsys:

PrinAncb:= first(b).(4)

gives

(SPADLET |PrinAncb| (ELT (CAR |b|) 4))

while

PrinAncb:= first (b).(4)

gives

(SPADLET |PrinAncb| (CAR (ELT |b| 4)))

Namely, precedence depends on presence or absence of space: without
space application have higher precence than ., with space lower.

BTW: NAG version was:

PrinAncb:= first (CatEval bname).(4)

Later I noticed that we can just use 'b' instead of 'CatEval bname'
so I replaced it by

PrinAncb:= first (b).(4)

For uniform look I changed this to:

PrinAncb:= first(b).(4)

but otherwise I did not look to much at this.  The change was
after switch to Shoe, so both versions had the same effect.

I must say that for me this example show how bad is practice
of ommiting parenthesis in function call with single argument
(note that with mandatory parenthesis there would be no question
of precedence -- call would always have higher precedence than '.').

-- 
                              Waldek Hebisch
[email protected] 

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to