Created
July 14, 2009 20:15
-
-
Save fffej/147160 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; From http://norvig.com/paip/patmatch.lisp | |
(defun match-if (pattern input bindings) | |
"Test an arbitrary expression involving variables. | |
The pattern looks like ((?if code) . rest)." | |
;; *** fix, rjf 10/1/92 (used to eval binding values) | |
(and (progv (mapcar #'car bindings) | |
(mapcar #'cdr bindings) | |
(eval (second (first pattern)))) | |
(pat-match (rest pattern) input bindings))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment