Fork me on GitHub

I'm not as conversant in macros, so it's probably pretty buggy


@john it seems because you're using a {} to store the impls, when a value satisfies multiple predicates, which one gets dispatched is random, isn't it? How about (def poly-atom (atom (array-map)))? That way we can implement prefer-method? This is first time I've seen predicate dispatch so I have no idea what I'm talking about.


@jaihindh.reddy I updated the example a bit, to read a bit clearer. Particular polys, like myincs or take-turns are stored as keys in the map. Their predicate implementations are conjed to a vector of vectors which contain pairs of predicates and functions, which apply to the params when the predicate returns true with the params.


prefer-method enhancement would need to replace the filtering functionality that runs over those pairs


Oops. The comment cleared it up. Got it.