Commit [7d15ab]  Maximize  Restore  History

In PART+ and PART*, only copy the input expression instead of calling

$RATEXPAND or $FACTOR, respectively.
Rationale: (1) $RATEXPAND and $FACTOR change the structure of the expression under
consideration, which (1a) is inconsistent with the spirit of formal pattern matching,
and (1b) makes it even more difficult to predict what the result will be;
(2) $RATEXPAND and $FACTOR are potentially very expensive operations,
and it is hard to predict which ones will be expensive -- some simple
expressions may take a very long time.

COPY-TREE is called instead of those operations because PART+ and PART*
or their callees sometimes (not sure about exactly what circumstances)
modify the input expression destructively. (So we cannot simply omit the
$RATEXPAND and $FACTOR calls; they must replaced by something which
yields a fresh expression.) It is conceivable that COPY-TREE could
sometimes or always be avoided, but for now, just play it safe.

robert_dodier robert_dodier 2006-11-19

changed maxima/src/matrun.lisp
maxima/src/matrun.lisp Diff Switch to side-by-side view
Loading...

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks