A record can implement a protocol without implementing any of its methods:
(defprotocol Structure (weight [this]) (balanced? [this])) (defrecord Mobile [] Structure )
... accepted.
If you try to use a nonexistent method:
(balanced? (Mobile.)) ;java.lang.AbstractMethodError: user.Mobile.balanced_QMARK_()Ljava/lang/Object;
As usual, type errors are detected at runtime.
Thumbnail
source share