Advertisement
Guest User

Untitled

a guest
Dec 1st, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. (defclass netfarm-class (standard-class)
  2. ())
  3.  
  4. (defclass netfarm-instance ()
  5. ((%name :initarg :name
  6. :reader netfarm-instance-name)
  7. (values :initarg :value-table
  8. :accessor netfarm-instance-value-table
  9. :initform (make-hash-table :test 'equal)))
  10. (:metaclass netfarm-class))
  11.  
  12. (defmethod closer-mop:slot-value-using-class ((class netfarm-class) (instance netfarm-instance) slot-definition)
  13. (let* ((slot-name (closer-mop:slot-definition-name slot-definition))
  14. (slot-string (string-downcase slot-name)))
  15. (multiple-value-bind (value win)
  16. (gethash slot-string (netfarm-instance-value-table instance))
  17. (if win
  18. value
  19. (call-next-method)))))
  20.  
  21. (defmethod closer-mop:validate-superclass ((class netfarm-class) (super-class standard-class))
  22. t)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement