Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1.  
  2. (defclass animal ()
  3. ((base-element :initform 'carbon :allocation :class :reader animal-base-element)))
  4.  
  5. (defparameter *a1* (make-instance 'animal))
  6. (animal-base-element *a1*) ; --> carbon
  7.  
  8. (defgeneric base-element (thing))
  9.  
  10. (defmethod base-element ((class (eql (find-class 'animal))))
  11. (animal-base-element (c2mop:class-prototype class)))
  12.  
  13. (base-element (find-class 'animal)) ; --> carbon
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement