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 3803


Ignore:
Timestamp:
2016-05-27T22:39:17-07:00 (8 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r3797 r3803  
    354354  self)
    355355
    356 (defun add (object1 object2)
     356(defun add-2 (object1 object2)
    357357  "Non-destructively add POLY1 by POLY2."
    358358  (add-to (copy-instance object1) (copy-instance object2)))
     359
     360(defun add (&rest summands)
     361  "Non-destructively adds list SUMMANDS."
     362  (cond ((endp summands) 0)
     363        ((endp (rest summands)) (first summands))
     364        (t (reduce #'add-2 summands :initial-value 0))))
     365
    359366
    360367(defun subtract (minuend  &rest subtrahends)
Note: See TracChangeset for help on using the changeset viewer.