From: Dieter K. <cra...@us...> - 2010-04-28 23:10:32
|
Update of /cvsroot/maxima/maxima/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv8758/src Modified Files: comm.lisp Log Message: Changing the global special variable islinp to *islinp*: 1. Removing the variable from declare-top. 2. Defining the variable as special with defvar. 3. Document the functionality of *islinp* in the routine chainrule. No problems with the testsuite or share_testsuite. Index: comm.lisp =================================================================== RCS file: /cvsroot/maxima/maxima/src/comm.lisp,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- comm.lisp 18 Apr 2010 17:16:04 -0000 1.41 +++ comm.lisp 28 Apr 2010 23:10:23 -0000 1.42 @@ -14,7 +14,7 @@ (declare-top (special $exptsubst $linechar $nolabels $inflag $piece $dispflag $gradefs $props $dependencies derivflag derivlist - $linenum $partswitch linelable nn* dn* islinp + $linenum $partswitch linelable nn* dn* $powerdisp atvars atp $errexp $derivsubst $dotdistrib $opsubst $subnumsimp $transrun in-p substp $sqrtdispflag $pfeformat dummy-variable-operators)) @@ -61,7 +61,6 @@ $dependencies '((mlist simp)) atvars '($@1 $@2 $@3 $@4) atp nil - islinp nil lnorecurse nil $derivsubst nil timesp nil @@ -69,6 +68,8 @@ in-p nil substp nil) +(defvar *islinp* nil) ; When T, sdiff is called from the function islinear. + (defmvar $vect_cross nil "If TRUE allows DIFF(X~Y,T) to work where ~ is defined in SHARE;VECT where VECT_CROSS is set to TRUE.") @@ -403,11 +404,13 @@ (defun chainrule (e x) (let (w) - (cond (islinp (if (and (not (atom e)) - (eq (caar e) '%derivative) - (not (freel (cdr e) x))) - (diff%deriv (list e x 1)) - 0)) + (cond (*islinp* + ;; sdiff is called from the function islinear. + (if (and (not (atom e)) + (eq (caar e) '%derivative) + (not (freel (cdr e) x))) + (diff%deriv (list e x 1)) + 0)) ((atomgrad e x)) ((not (setq w (mget (cond ((atom e) e) ((member 'array (cdar e) :test #'eq) (caar e)) |