close Warning: Can't synchronize with repository "(default)" (The repository directory has changed, you should resynchronize the repository with: trac-admin $ENV repository resync '(default)'). Look in the Trac log for more information.

Changeset 4227


Ignore:
Timestamp:
2016-06-04T18:45:19-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/integer-ring.lisp

    r4224 r4227  
    3030           "UNIVERSAL-EZGCD"
    3131           "UNIVERSAL-EQUALP"
    32            "UNIVERSAL-ZEROP"))
     32           "UNIVERSAL-ZEROP"
     33           "->SEXP")
     34  (:documentation "Wraps integers into an object."))
    3335
     36(in-package "INTEGER-RING")
    3437
    3538(defclass integer-ring (ring)
     
    5053        other
    5154    (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))))
    5263  self)
    5364
     
    7586      (setf value (gcd value other-value))))
    7687  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.