Coverage report: /home/ellis/comp/core/lib/obj/id.lisp
Kind | Covered | All | % |
expression | 4 | 26 | 15.4 |
branch | 0 | 0 | nil |
Key
Not instrumented
Conditionalized out
Executed
Not executed
Both branches taken
One branch taken
Neither branch taken
1
;;; lib/obj/id.lisp --- IDs
9
((id :initarg :id :initform 0 :accessor id :type fixnum)))
11
(defmethod id (self) (hash-object-address self))
13
(defgeneric reset-id (obj)
14
(:documentation "Reset the id slot of SELF to 0.")
15
(:method ((obj standard-object)) (setf (id obj) 0))
16
(:method ((obj t)) 0))
18
(defgeneric update-id (obj)
19
(:documentation "Update the id slot of SELF.")
20
(:method ((obj standard-object)) (setf (id obj) (hash-object obj)))
21
(:method ((obj t)) (hash-object obj)))
23
(defgeneric make-id (kind)
24
(:documentation "Allocate a new ID object of a specified KIND.")
25
(:method ((kind (eql nil)))
26
(declare (ignore kind))
28
(:method ((kind (eql t)))
29
(declare (ignore kind))
30
(make-instance 'id :id most-positive-fixnum)))
32
(defmethod print-object ((obj id) stream)
33
(print-unreadable-object (obj stream :type "ID")
34
(format stream "~A" (id obj))))
36
(defclass id-factory () ())
38
(defgeneric identify (self)
39
(:documentation "Return the identity of object SELF - usually meant for objects which don't
40
specialize on ID but should still sometimes return an ID."))