daily pastebin goal
17%
SHARE
TWEET

Untitled

a guest Mar 15th, 2019 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defgeneric foobar (arg0 arg1))
  2.  
  3. (defmethod foobar (arg0 arg1)
  4.   (format t "0~%"))
  5.  
  6. (defmethod foobar (arg0 (arg1 string))
  7.   (format t "1~%"))
  8.  
  9. (defmethod foobar ((arg0 number) (arg1 string))
  10.   (format t "2~%"))
  11.  
  12. (defmethod foobar ((arg0 string) (arg1 number))
  13.   (format t "3~%"))
  14.  
  15. CL-USER> (foobar 0 0)
  16. 0
  17. NIL
  18. CL-USER> (foobar :thing "hi")
  19. 1
  20. NIL
  21. CL-USER> (foobar 0 "hi")
  22. 2
  23. NIL
  24. CL-USER> (foobar "hi" 12)
  25. 3
  26. NIL
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top