Welcome! Please see the About page for a little more info on how this works.

+8 votes
in Protocols by
I'd expect that `satisfies?` works even when providing protocol implementation via metadata, however that doesn't seem to be the case:


(defprotocol Foo :extend-via-metadata true (foo [x]))
(foo (with-meta [42] {`foo (fn [x] :boo)}))
;; => :boo

;; but `satisfies?` doesn't work
(satisfies? Foo (with-meta [42] {`foo (fn [x] :boo)}))
;; => false


*Patch*: 0001-CLJ-2426-fix-satisfies-for-new-instance-based-protoc.patch
by
Ran into this yesterday.

2 Answers

0 votes
by

Comment made by: alexmiller

Would it be better to put the metadata check second instead of first for perf? Or is it actually faster?

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-2426 (reported by jumar)
...