Pattern Matching in Clojure
summary
History links Prolog unification and Erlang one-way matching to Clojure macros; practical claim is that core.match plus the defun wrapper defun give concise pattern-dispatch and make recursion readable. Examples include replacing nested conditionals, expressing zipmap as pattern cases, and using guards for predicates. Limitations: guards can’t easily reference multiple arguments, patterns are evaluated in order, ClojureScript lacks defun support, and macros trade some runtime speed for developer clarity. Core.logic offers true unification for two-way matching.
AI-written summary · about
chapters (18)
- 0:00Introduction
- 0:20Agenda
- 0:47Presentation Overview
- 1:22History of Pattern Matching
- 2:47Unification
- 6:15Binding and Unbound
- 7:15Pattern Matching in Erlang
- 15:26Macros
- 16:32CoreMatch
- 17:59CoreMatch Example
- 21:30Let Things Crash
- 23:29Closure Script Support
- 28:44Pattern Matching in Practice
- 30:38Guard Expressions
- 32:12Best Practices
- 33:52Recursive
- 38:00Conclusion
- 38:49Questions
related talks
45mLearn you some pattern matching for great good!
48mAncestry of Polymorphism in Clojure
01h 02mSolving Problems the Clojure Way
40mFun with Functional Programming in Clojure
54mDesign Patterns vs Anti pattern in APL
39mFunctional Concepts in Elixir
01h 02mAdvanced Pattern Matching in C#
38mFun with Functional Programming in Clojure
