<< Back to previous view

[CLJ-825] Protocol implementation inconsistencies Created: 08/Aug/11  Updated: 08/Aug/11

Status: Open
Project: Clojure
Component/s: None
Affects Version/s: Release 1.2, Release 1.3
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Carl Lerche Assignee: Unassigned
Resolution: Unresolved Votes: 3
Labels: None
Environment:

All


Attachments: File scribbles.clj    

 Description   

There seems to be some inconsistencies when implementing protocols that have multi arity functions depending on how the protocol is implemented. I have attached a clj file illustrating this. The short version is that multi arity must be defined as such w/ defrecord:

(defrecord Zomg []
SomeProto
(hello [_] 1)
(hello [_ _] 1))

And as such with extend-type

(extend-type Object
SomeProto
(hello
([_] 1)
([_ _] 1)))

I have only tested defrecord & extend-type. I am unsure how it works with deftype and extend-protocol.


Generated at Sun May 19 01:21:07 CDT 2013 using JIRA 4.4#649-r158309.