[CLJS-398] new macro cljs.core/extend-instance Created: 19/Oct/12 Updated: 19/Oct/12 Resolved: 19/Oct/12
|Patch:||Code and Test|
Patch introduces an extend-instance macro, similar to extend-type.
This is useful to let existing instances, e.g. parsed JSON directly implement a protocol.
|Comment by David Nolen [ 19/Oct/12 5:13 PM ]|
Rich Hickey already had a good name for an operation like this - specify.
|Comment by Herwig Hochleitner [ 19/Oct/12 6:10 PM ]|
OK, I've declined the ticket, since not only the name but also the patches should be disregarded.
The problem with above impl is that the generated implementing fns get instantiated, every time extend-instance is evaluated. That is not acceptable on a per-instance basis.
I will work on a new macro called specify, which allows passing implementing fns.
Is a syntax similar to clojure.core/extend right for specify?
|Comment by David Nolen [ 19/Oct/12 7:51 PM ]|
As far as I understand it the interface for specify should be the same as extend-type.