Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. (defclass foo () ((bar :initarg := :initform '())))
  2.  
  3. (defmethod make-instance :around ((type (eql 'foo)) &key =)
  4. (if (not =) nil (call-next-method)))
  5.  
  6. (print (make-instance 'foo)) ;; => NIL
  7.  
  8. (print (let ((x (make-instance 'foo))) x)) ;; => #<FOO {10037EEDF3}>
  9.  
  10. (print (let ((x (apply #'make-instance (list 'foo)))) x)) ;; => NIL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement