Changeset 4445 for branches/f4grobner
- Timestamp:
- 2016-06-11T08:33:20-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/monom.lisp
r4368 r4445 517 517 518 518 (defmethod shared-initialize :around ((self term) slot-names &rest initargs &key (coeff 1)) 519 "A convenience method. If a coefficient is an integer, wrap it in the INTEGER-RING object" 519 "A convenience method. If a coefficient is an integer or rational, wrap it in 520 the INTEGER-RING or RATIONAL-FIELD object, respectively." 520 521 ;; Dispatch on the type of supplied :COEFF arg 521 522 (typecase coeff … … 526 527 ;; Now pass new initargs to the next method 527 528 (apply #'call-next-method (list* self slot-names initargs))) 529 530 (defmethod (setf term-coeff) :after (new-value (object term)) 531 "A conveniense method. If an integer or rational value is assigned to the slot, 532 it is wrapped into an INTEGER-RING or RATIONAL-FIELD object, respectively." 533 (with-slots (coeff) 534 object 535 (typecase coeff 536 (integer 537 (setf coeff (make-instance 'integer-ring :value coeff))) 538 (rational 539 (setf coeff (make-instance 'rational-field :value coeff)))))) 528 540 529 541
Note:
See TracChangeset
for help on using the changeset viewer.