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 4376 for branches


Ignore:
Timestamp:
2016-06-06T19:53:00-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/ring.lisp

    r4374 r4376  
    102102should be returned upon every call."))
    103103
    104 (defun add (summand &rest more-summands)
     104(defgeneric add (summand &rest more-summands)
    105105  "Successively Adds to SUMMAND the elements of MORE-SUMMANDS. The first SUMMAND must not be destructively modified.
    106106Instead, a copy of factor should be made and returned as the value of
     
    108108  (:method ((summand t) &rest more-summands)
    109109    (reduce #'add-to more-summands :initial-value (copy-instance summand))))
     110
     111(defgeneric subtract (minuend  &rest subtrahends)
     112  "Non-destructively subtract MINUEND and SUBTRAHENDS."
     113  (:method ((minuend t) &rest subtrahends)
     114    (cond ((endp subtrahends) (unary-minus (copy-instance minuend)))
     115          (t (reduce #'subtract-from (copy-instance minuend) subtrahends)))))
    110116
    111117(defgeneric multiply (factor &rest more-factors)
Note: See TracChangeset for help on using the changeset viewer.