Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defgeneric foobar (arg0 arg1))
- (defmethod foobar (arg0 arg1)
- (format t "0~%"))
- (defmethod foobar (arg0 (arg1 string))
- (format t "1~%"))
- (defmethod foobar ((arg0 number) (arg1 string))
- (format t "2~%"))
- (defmethod foobar ((arg0 string) (arg1 number))
- (format t "3~%"))
- CL-USER> (foobar 0 0)
- 0
- NIL
- CL-USER> (foobar :thing "hi")
- 1
- NIL
- CL-USER> (foobar 0 "hi")
- 2
- NIL
- CL-USER> (foobar "hi" 12)
- 3
- NIL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement