In Clojure 1.2:

(defprotocol PP 
  (foo [bar]) 
  (foo [bar baz]))
=> PP

(extend-protocol PP 
  Object 
    (foo [bar] 1) 
    (foo [bar baz] 2))
=> nil

(foo "hello!")
=> #<CompilerException java.lang.IllegalArgumentException: No single method: foo of interface: PP found for function: foo of protocol: PP

Where am I going wrong? I'd expect to see 1 as the result from the single-argument version of the foo function, since "hello!" is clearly an instance of java.lang.Object.

Edit
Report