Skip to content

Instantly share code, notes, and snippets.

@teddziuba
Created July 30, 2014 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teddziuba/12530cdcf6d82bbf7042 to your computer and use it in GitHub Desktop.
Save teddziuba/12530cdcf6d82bbf7042 to your computer and use it in GitHub Desktop.
cljwtf
user=> (defprotocol P
#_=> (foo [x])
#_=> (bar [x]))
P
user=> (defrecord X [a b]
#_=> P
#_=> (foo [this] a))
user.X
user=> (def x (->X 1 2))
#'user/x
user=> (satisfies? P x)
true
user=> (bar x)
AbstractMethodError user.X.bar()Ljava/lang/Object; user/eval722 (NO_SOURCE_FILE:1)
user=> (foo x)
1
user=>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment