Changeset 3289
- Timestamp:
- 2015-06-23T08:39:32-07:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/monom.lisp
r3288 r3289 56 56 (exponents :initarg :exponents :accessor monom-exponents 57 57 :documentation "The powers of the variables.")) 58 ;; default-initargs are not needed, they are handled by SHARED-INITIALIZE 59 ;;(:default-initargs :dimension 'foo :exponents 'bar :exponent 'baz) 58 60 (:documentation 59 61 "Implements a monomial, i.e. a product of powers … … 70 72 (defmethod shared-initialize :after ((self monom) slot-names 71 73 &key 72 dimension73 exponents74 exponent74 (dimension 0 dimension-supplied-p) 75 (exponents nil exponents-supplied-p) 76 (exponent nil exponent-supplied-p) 75 77 &allow-other-keys 76 78 ) … … 79 81 (case slot-name 80 82 (dimension 81 (cond (dimension 83 (cond (dimension-supplied-p 82 84 (setf (slot-value self 'dimension) dimension)) 83 (exponents 85 (exponents-supplied-p 84 86 (setf (slot-value self 'dimension) (length exponents))) 85 87 (t 86 (error "DIMENSION or EXPONENTS must not be NIL"))))88 (error "DIMENSION or EXPONENTS must be supplied.")))) 87 89 (exponents 88 90 (cond 89 ;; when exponents are supplied 90 (exponents 91 (exponents-supplied-p 91 92 (let ((dim (length exponents))) 92 (when (and dimension (/= dimension dim))93 (when (and dimension-supplied-p (/= dimension dim)) 93 94 (error "EXPONENTS must have length DIMENSION")) 94 95 (setf (slot-value self 'dimension) dim
Note:
See TracChangeset
for help on using the changeset viewer.