Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tomjack
Created October 29, 2012 19:25
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 tomjack/c06b191ee5657ce8a668 to your computer and use it in GitHub Desktop.
Save tomjack/c06b191ee5657ce8a668 to your computer and use it in GitHub Desktop.
user> (defprotocol Foo (foo [_]))
Foo
user> (defrecord FooR [foo] Foo (foo [_] foo))
user.FooR
user> (foo (FooR. 23))
23
user> (ns foo)
nil
foo> (defprotocol Foo (foo [_]))
Foo
foo> (extend-type user.FooR Foo (foo [_] 42))
nil
foo> (foo (user.FooR. 23))
42
foo> (in-ns 'user)
#<Namespace user>
user> (foo (FooR. 23))
23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment