Browse Source

Add subtraction expression copying

Samuel W. Flint 4 years ago
parent
commit
97402356f3
1 changed files with 4 additions and 0 deletions
  1. 4 0
      larcs.org

+ 4 - 0
larcs.org

@@ -391,6 +391,10 @@ Subtractions again, contain only a list of terms.  However, unlike other types h
   (defmethod to-sexp ((expression <subtraction>) &optional resolve-constants-p)
     `(- ,@(mapcar #'(lambda (exp) (to-sexp exp resolve-constants-p))
                   (slot-value expression 'terms))))
+
+  (defmethod copy-expression ((expression <subtraction>))
+    (make-instance '<subtraction>
+                   :terms (mapcar #'copy-expression (slot-value expression 'terms))))
 #+END_SRC
 
 *** DONE Multiplications