Skip to content

Instantly share code, notes, and snippets.

@cemerick
Created April 20, 2013 15:54
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 cemerick/5426430 to your computer and use it in GitHub Desktop.
Save cemerick/5426430 to your computer and use it in GitHub Desktop.
Only the first type specified in extend-protocol can be specified by an expression...
(defprotocol Foo (foo [x]))
(extend-protocol Foo
(identity String)
(foo [x]))
nil
(defprotocol Bar (bar [x]))
(extend-protocol Bar
String
(bar [x])
(class (byte-array 0))
(bar [x]))
CompilerException java.lang.UnsupportedOperationException: nth not supported on this type: Symbol, compiling:(NO_SOURCE_PATH:1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment