Changeset 4227
- Timestamp:
- 2016-06-04T18:45:19-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/integer-ring.lisp
r4224 r4227 30 30 "UNIVERSAL-EZGCD" 31 31 "UNIVERSAL-EQUALP" 32 "UNIVERSAL-ZEROP")) 32 "UNIVERSAL-ZEROP" 33 "->SEXP") 34 (:documentation "Wraps integers into an object.")) 33 35 36 (in-package "INTEGER-RING") 34 37 35 38 (defclass integer-ring (ring) … … 50 53 other 51 54 (setf value (* value other-value)))) 55 self) 56 57 (defmethod divide-by ((self integer-ring) (other integer-ring)) 58 (with-slots (value) 59 self 60 (with-slots ((other-value value)) 61 other 62 (setf value (/ value other-value)))) 52 63 self) 53 64 … … 75 86 (setf value (gcd value other-value)))) 76 87 self) 88 89 (defmethod universal-equalp ((self integer-ring) (other integer-ring)) 90 (with-slots (value) 91 self 92 (with-slots ((other-value value)) 93 other 94 (= value other-value)))) 95 96 (defmethod ->sexp ((self integer-ring)) 97 (integer-ring-value self))
Note:
See TracChangeset
for help on using the changeset viewer.