;; returns #f if failed match
;; returns a list of matched variables (or null if no variable names specified.)
(define match
(lambda (em)
(lambda (e)
(let* ((res (match-expr e em))
(pairs (if (null? res) '()
(map (lambda (x)
(if (vector? x)
(vector->list x)
x))
res))))
(if (tree-member MATCH-FAILED res)
#f
pairs)))))