Does this mean that this is a bug or something crucial related to protocol design is preventing this ever being implemented?
-Vjeran
Brandon Bloom
unread,
Jun 6, 2016, 10:23:04 PM6/6/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Link
Report message as abuse
Sign in to report message as abuse
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Clojure
Just guessing from past experience in the Clojure internals:
Instrumenting protocol methods it likely possible, but unlikely to be worth the effort.
There are already a bunch of places where protocol functions are different. The accepted convention is to always wrap a protocol method with a normal function to recover the benefits. The pattern usually looks like:
(defprotocol P
(-foo [x y z]))
(defn foo [x y z]
(-foo x y z))
Put your spec on foo, not -foo.
This tends to be good practice anyway because you have a place to wrap global behavior around -foo.