Changeset 4530 for branches/f4grobner
- Timestamp:
- 2016-06-17T18:45:17-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/polynomial-sugar.lisp
r4524 r4530 32 32 "ADD-TO" 33 33 "MULTIPLY-BY" 34 "MAKE-UNIT-FOR" 34 35 ) 35 36 (:documentation "Implements 'sugar'.")) … … 48 49 (:method ((object poly)) 49 50 "Static sugar of a poly OBJECT is the maximum sugar of its terms." 50 (with- slots (termlist)51 (with-accessors ((termlist poly-termlist)) 51 52 object 52 53 (loop for trm in termlist maximize (static-sugar trm))))) … … 68 69 "Initialize sugar value based on the exponents." 69 70 (declare (ignore slot-names initargs)) 70 (setf (slot-value self 'value) (static-sugar self))) 71 (with-slots (value) 72 self 73 (setf value (static-sugar self)))) 71 74 72 75 (defmethod update-instance-for-different-class :after ((old monom) (new monom-with-sugar) &key) … … 102 105 (defmethod shared-initialize :after ((self term-with-sugar) slot-names &rest initargs &key) 103 106 (declare (ignore slot-names initargs)) 104 (setf (slot-value self 'value) (static-sugar self))) 107 (with-slots (value) 108 self 109 (setf value (static-sugar self)))) 105 110 106 111 … … 124 129 "Initialize sugar to its static value, which is the maximum of sugar values of the terms." 125 130 (declare (ignore slot-names initargs)) 126 (setf (slot-value self 'value) (static-sugar self)))131 (setf (slot-value self 'value) (static-sugar self))) 127 132 128 133 (defmethod update-instance-for-different-class :after ((old poly) (new poly-with-sugar) &key) … … 162 167 (setf value (max value other-value)))) 163 168 self) 169 170 (defmethod make-unit-for ((object poly-with-sugar)) 171 (change-class (call-next-method) 'poly-with-sugar))
Note:
See TracChangeset
for help on using the changeset viewer.