axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] any?, member?, ...


From: Martin Rubey
Subject: Re: [Axiom-developer] any?, member?, ...
Date: Wed, 23 Jun 2004 17:13:36 +0000

William Sit writes:
 > That was my thoughts when I read your preliminary patch 3148:
 > 
 > >      dvdsum(l, x) ==
 > >        x = retract(y := third l)@SE => 0
 > > -      k := retract(d := second l)@K
 > > -      differentiate(h := third rest rest l,x) * eval(f := first l, k, h)
 > > -        - differentiate(g := third rest l, x) * eval(f, k, g)
 > > -             + opdsum [differentiate(f, x), d, y, g, h]
 > > +      if member?(x, variables(h := third rest rest l)) or 
 > > +         member?(x, variables(g := third rest l)) then
 > > +        dm := dummy
 > > +        kernel(opdiff, [eval(opdsum(l), x::F, dm), dm, x::F])
 > > +      else
 > > +        opdsum [differentiate(first l, x), second l, y, g, h]
 > >  
 > 
 > Note that g would not have been defined in some cases in the last line if
 > the operator OR does not evaluate all its clauses first. 

Hmm, if the first member? succeeds, g won't be defined but that's no problem,
because it won't be used. If the first member? fails, the second member? will
be evaluated and g will be defined. Only if both member? fail, the "else" part
of the if statement will be evaluated and only in this case g is needed.

???

Martin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]