Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (ns devon.demo)
- (defprotocol Show
- (show [this]))
- (extend-protocol Show
- java.lang.String
- (show [this] (println this))
- some-ns.Person
- (show [this] (println this.toString)))
- (show "Hello") ;console: "Hello", return-val: nil
- (show (Person. "Name")) ; console: "Name", return-val: nil
Add Comment
Please, Sign In to add comment