Sorry, the macro definition relies on a few additional functions,
in particular on the (ice-9 match) and (srfi srfi-1) modules and 
the following definitions:

(define (split-before criterion list)
  (split-at list (or (list-index criterion list)
                     (length list))))

(define (equals? x) (lambda(y)(equal? x y)))