(defun match (pat inp) (matchb pat inp '((t . t)))) (defun matchb (pat inp bindings) (and bindings (if (consp pat) (and (consp inp) (matchb (cdr pat) (cdr inp) (matchb (car pat) (car inp) bindings))) (if (varp pat) (let ((bind (assoc pat bindings))) (if bind (and (equal inp (cdr bind)) bindings) (cons (cons pat inp) (if (eq (caar bindings) t) nil bindings)))) (and (eql pat inp) bindings)) ) ) ) (defun varp (v) (and (symbolp v) (char= #\? (char (symbol-name v) 0))) )
Contents    Page-10    Prev    Next    Page+10    Index