привет, можно как-то такое починить?
(defprotocol Foo
(foo [_]))
(extend-protocol Foo
IMapEntry
(foo [_]
"IMapEntry")
IPersistentVector
(foo [_]
"IPersistentVector"))
(comment
(foo (first {:a :b}))) => "IPersistentVector"
You can implement a protocol on an interface
this is primarily to facilitate interop with the host (e.g. Java)
but opens the door to incidental multiple inheritance of implementation
since a class can inherit from more than one interface, both of which implement the protocol
if one interface is derived from the other, the more derived is used, else which one is used is unspecified.
спасибо
@pavetok возможно, такой вариант вполне устроит:
(extend-protocol Foo
MapEntry
(foo [_]
"MapEntry")
IPersistentVector
(foo [_]
"IPersistentVector"))