Lisp Match

(DEF MATCH (PATTERN ASSERTION)
   (COND ((EQUAL PATTERN '?) T)
         ((AND (ATOM PATTERN)
               (EQUAL PATTERN ASSERTION)) T)
         ((ATOM PATTERN) NIL)
         ((ATOM ASSERTION) NIL)
         (T (AND (MATCH (FIRST PATTERN) (FIRST ASSERTION))
                 (MATCH (REST PATTERN) (REST ASSERTION))))))
FIRST <- CAR
REST <- CDR
This entry was posted in General. Bookmark the permalink.