Changeset 2208
- Timestamp:
- 2015-06-18T09:38:42-07:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/monom.lisp
r2207 r2208 74 74 to 0. Alternatively, all elements may be specified as a list 75 75 EXPONENTS." 76 (with-slots (dimension exponents) 77 self 78 (setf dimension (cond (dimension-suppied-p dimension) 79 (exponents-supplied-p (length exponents)) 80 (t (error "You must provide DIMENSION or EXPONENTS"))) 81 exponents (cond 82 ;; when exponents are supplied 83 (exponents-supplied-p 84 (when (and dimension-suppied-p (/= dimension (length exponents))) 85 (error "EXPONENTS must have length DIMENSION")) 86 (make-array (list dimension) :initial-contents exponents 87 :element-type 'exponent)) 88 ;; when all exponents are to be identical 89 (exponent-supplied-p 90 (make-array (list dimension) :initial-element exponent 91 :element-type 'exponent)) 92 ;; otherwise, all exponents are zero 93 (t 94 (make-array (list dimension) :element-type 'exponent :initial-element 0))))) 76 (setf (slot-value self 'dimension) (cond (dimension-suppied-p dimension) 77 (exponents-supplied-p (length exponents)) 78 (t (error "You must provide DIMENSION or EXPONENTS"))) 79 (slot-value self 'exponents) (cond 80 ;; when exponents are supplied 81 (exponents-supplied-p 82 (when (and dimension-suppied-p (/= dimension (length exponents))) 83 (error "EXPONENTS must have length DIMENSION")) 84 (make-array (list dimension) :initial-contents exponents 85 :element-type 'exponent)) 86 ;; when all exponents are to be identical 87 (exponent-supplied-p 88 (make-array (list dimension) :initial-element exponent 89 :element-type 'exponent)) 90 ;; otherwise, all exponents are zero 91 (t 92 (make-array (list dimension) :element-type 'exponent :initial-element 0)))) 95 93 (call-next-method)) 96 94
Note:
See TracChangeset
for help on using the changeset viewer.