pattern matching
Libraries adding data-structure pattern matching operations to Common Lisp.

We recommend optima or trivia for pattern matching. For unification, see unification.

  • bind - Bind combines let*, destructuring-bind and multiple-value-bind into a single form
  • bpm2 - bpm2 is a pattern matching language originally designed for doing code transformation [ie, writing compilers]
  • cartesian-product-switch - cartesian-product-switch is a macro for choosing the appropriate form to execute according to the combined results of multiple tests
  • cl-unification - Provides unification (as used in Prolog) over fairly arbitrary Common Lisp objects
  • cl-xmlspam - XML Stream PAttern Matcher - concise, regexp-like pattern matching on streaming XML
  • let-plus - [unmaintained, maintainers welcome] LET+ extends let* with destructuring forms, slot access, hash table elements and various other constructs with a consistent interface
  • MCPat - MCPat is a meta-circular pattern matching library
  • screamer - Screamer adds support for nondeterministic and constraint programming, including backtracking and undoable side-effects
  • spath - SPath is a library for running search queries against s-expressions, intended to match parts of them that the user needs
  • Toadstool - Toadstool is a library for pattern matching
  • Trivia - Trivial pattern matching compiler
  • type-r - The complete collection of accessor functions and patterns to access the elements in a compound type specifier

See also:

  • Screamer
  • EEL
  • destructuring-bind can be used to bind variables to components of a tree, but does not provide for multiple alternative patterns.
  • typecase can be used to test structures against a pattern (type), but does not destructure.