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

We recommend trivia for pattern matching, that is a drop-in replacement for optima. 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 - LET+ extends let* with destructuring forms, slot access, hash table elements and various other constructs with a consistent interface
  • 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:

  • 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.
  • cl-phonetic — phonetical pattern matcher (work in progress)