Share your thoughts in the 2021 Clojure Community Survey!

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

+2 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

2 Answers

0 votes

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
Reference: (reported by jumar)