소스 검색

Add subtraction expression copying

Samuel W. Flint 6 년 전
부모
커밋
97402356f3
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  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