Context
I apologize for this question being soft / philosophical; it’s a set of ideas / observations / intuition that I can’t formalize.
I’ve recently been writing large applications in Clojure, and playing with
* clojure’s match macro
* rule dispatch systems of (1) moustache and (2) compojure
* com.cederick’s friend for security
What I like about all three — is that rather than objects having functions, all three involve some explicit form of pattern matching to dispatch what happens next.
Question
Is there a general programming technique behind this? If so, what is it called? Where else does this pattern show up, and how can I learn more about it?
Thanks!
Pattern matching is currently not part of clojure/core right now, but you can use multimethod, cond, case macro , and the https://github.com/clojure/core.match library.