I have a protocol:
(defprotocol IInterval
(-duration [in]))
and a record that implements it:
(defrecord Interval [start end]
IInterval
(-duration [_] (- end
start)))
if I create (def i1 (Interval 0 1000))
how would I be able to the method implements?
where:
(implements? IInterval i1) => true
You can use satisfies?
:
(satisfies? IInterval i1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With