Skip to content

Instantly share code, notes, and snippets.

@KirinDave
Created June 3, 2010 15:43
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 KirinDave/f680abfeb365a3f881e6 to your computer and use it in GitHub Desktop.
Save KirinDave/f680abfeb365a3f881e6 to your computer and use it in GitHub Desktop.
~/Projects/blogtoys/ex % 〕clojure ← 0
Clojure 1.2.0-master-SNAPSHOT
user=> (ns a)
nil
a=> (defprotocol testp (x [this]))
testp
a=> (ns b)
nil
b=> (defprotocol testp (x [this]))
testp
b=> (in-ns 'user)
#<Namespace user>
user=> a/testp
{:on-interface a.testp, :on a.testp, :sigs {:x {:doc nil, :arglists ([this]), :name x}}, :var #'a/testp, :method-map {:x :x}, :method-builders {#'a/x #<a$eval16$fn__17 a$eval16$fn__17@7f26d3df>}}
user=> b/testp
{:on-interface b.testp, :on b.testp, :sigs {:x {:doc nil, :arglists ([this]), :name x}}, :var #'b/testp, :method-map {:x :x}, :method-builders {#'b/x #<b$eval48$fn__49 b$eval48$fn__49@2bbe2893>}}
user=> (deftype TestType [internal structure]
a/testp
(x [this] internal)
b/testp
(x [this] structure))
java.lang.ClassFormatError: Duplicate method name&signature in class file user/TestType (NO_SOURCE_FILE:9)
user=> ; but oddly enough
user=> (extend-type java.lang.String
a/testp
(x [this] 1)
b/testp
(x [this] 2))
nil
; That's fine?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment