The Recursive Function Pattern Matching Pattern

(written by lawrence krubner, however indented passages are often quotes). You can contact lawrence at: lawrence@krubner.com

Sean Johnson has a great video up. Common in Erlang, useful in Clojure, 3 functions, one to start, one to do the work, one to end, all defined by arity, using Pattern Matching.

Also called the “Start, Work, End” pattern.

This is often done in Clojure with zipmap, but this does not make things as clear as the Erlang version:

This is much more clear:

Source