Details
-
Type:
Enhancement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Duplicate
-
Affects Version/s: Backlog
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
To improve Midje checkers/assertions, it'd be useful if we could ask an object if it were a-maplike-object-due-to-defrecord, rather than just ask it #'map?
I have also run into the need to do this when implementing multimethods where records were treated in a specific way (for printing for example).
We wrapped defmacro to install a multimethod implementation of a record? function at record definition time but that's not a generic solution.
I imagine it would be easy for defrecord to construct a class that implements a marker IRecord interface that is checked by a record? predicate.