|
@@ -415,6 +415,14 @@ Subtractions again, contain only a list of terms. However, unlike other types h
|
|
|
(defmethod copy-expression ((expression <subtraction>))
|
|
|
(make-instance '<subtraction>
|
|
|
:terms (mapcar #'copy-expression (slot-value expression 'terms))))
|
|
|
+
|
|
|
+ (defmethod substitute-expression (replace replacement (expression <subtraction>))
|
|
|
+ (if (eqal replace expression)
|
|
|
+ replacement
|
|
|
+ (make-instance '<subtraction>
|
|
|
+ :terms (mapcar #'(lambda (exp)
|
|
|
+ (substitute-expression replace replacement exp))
|
|
|
+ (slot-value expression 'terms)))))
|
|
|
#+END_SRC
|
|
|
|
|
|
*** WORKING Multiplications
|