close Warning: Can't synchronize with repository "(default)" (The repository directory has changed, you should resynchronize the repository with: trac-admin $ENV repository resync '(default)'). Look in the Trac log for more information.

Changeset 4104 for branches


Ignore:
Timestamp:
2016-06-01T12:40:24-07:00 (8 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r4103 r4104  
    388388
    389389(defmethod add-to ((self poly) (other term))
    390   "Adds to a polynomial SELF a term OTHER. This operation
    391 destructively modifies OTHER. This operation observes the order of terms."
    392   (with-slots (termlist order)
    393       self
    394     (setf termlist (merge 'list termlist (list other) order))))
     390  "Adds to a polynomial SELF a term OTHER."
     391  (add-to self (change-class (copy-instance other) 'poly)))
    395392
    396393(defmethod subtract-from ((self poly) (other term))
    397   "Subtracts from a polynomial SELF a term OTHER. This operation
    398 destructively modifies OTHER."
    399   (with-slots (termlist order)
    400       self
    401     (setf termlist (merge 'list termlist (list other) order))))
    402 
     394  "Subtracts from a polynomial SELF a term OTHER."
     395  (subtract-from self (change-class (copy-instance other) 'poly)))
    403396
    404397
Note: See TracChangeset for help on using the changeset viewer.