;; emacs lisp takes 2,187µs
(* (/ (car (benchmark-run 100
             ((lambda (assoc evlis evlam zip apply ev)
                (funcall ev
                         (quote
                          (ev (q (ff x))
                              (q ((ff ((x)
                                       ((atom x) x)
                                       (ff (head x))))
                                  (x ((a) b c))))))
                         (quote
                          ((noll ((x)
                                  (eq x ())))
                           (list ((x y)
                                  (link x (link y ()))))
                           (assoc ((x y)
                                   ((noll y) (link (q wut) x))
                                   ((eq x (head (head y)))
                                    (head (tail (head y))))
                                   (assoc x (tail y))))
                           (evlam ((c a)
                                   ((noll (tail c))
                                    (ev (head c) a))
                                   ((ev (head (head c)) a)
                                    (evlam (tail (head c)) a))
                                   (evlam (tail c) a)))
                           (zip ((x y a)
                                 ((noll x) a)
                                 (link (list (head x) (head y))
                                       (zip (tail x) (tail y) a))))
                           (evlis ((m a)
                                   ((noll m) m)
                                   (link (ev (head m) a)
                                         (evlis (tail m) a))))
                           (apply ((fn x a)
                                   ((atom fn)
                                    ((eq fn (q head)) (head (head x)))
                                    ((eq fn (q tail)) (tail (head x)))
                                    ((eq fn (q atom)) (atom (head x)))
                                    ((eq fn (q link))
                                     (link (head x) (head (tail x))))
                                    ((eq fn (q eq))
                                     (eq (head x) (head (tail x))))
                                    (apply (ev fn a) x a))
                                   (evlam (tail fn) (zip (head fn) x a))))
                           (ev ((e a)
                                ((noll e) e)
                                ((atom e) (assoc e a))
                                ((atom (head e))
                                 ((eq (head e) (q q)) (head (tail e)))
                                 (apply (head e) (evlis (tail e) a) a))
                                (apply (head e) (evlis (tail e) a) a)))))))
              (quote
               (lambda (x y)
                 (cond ((eq x (car (car y)))
                        (car (cdr (car y))))
                       ((quote t)
                        (funcall assoc x (cdr y))))))
              (quote
               (lambda (m a)
                 (cond (m (cons (funcall ev (car m) a)
                                (funcall evlis (cdr m) a)))
                       ((quote t) m))))
              (quote
               (lambda (c a)
                 (cond ((eq () (cdr c))
                        (funcall ev (car c) a))
                       ((funcall ev (car (car c)) a)
                        (funcall evlam (cdr (car c)) a))
                       ((quote t)
                        (funcall evlam (cdr c) a)))))
              (quote
               (lambda (x y a)
                 (cond (x (cons (cons (car x) (cons (car y) ()))
                                (funcall zip (cdr x) (cdr y) a)))
                       ((quote t) a))))
              (quote
               (lambda (fn x a)
                 (cond
                   ((atom fn)
                    (cond ((eq fn (quote head))
                           (cond ((car x) (car (car x))) (t ())))
                          ((eq fn (quote tail))
                           (cond ((car x) (cdr (car x))) (t ())))
                          ((eq fn (quote atom))
                           (atom (car x)))
                          ((eq fn (quote link))
                           (cons (car x) (car (cdr x))))
                          ((eq fn (quote eq))
                           (eq (car x) (car (cdr x))))
                          ((quote t)
                           (funcall apply (funcall ev fn a) x a))))
                   ((quote t)
                    (funcall evlam (cdr fn) (funcall zip (car fn) x a))))))
              (quote
               (lambda (e a)
                 (cond ((eq e ()) e)
                       ((atom e) (funcall assoc e a))
                       ((atom (car e))
                        (cond ((eq (car e) (quote q)) (car (cdr e)))
                              ((quote t)
                               (funcall apply (car e) (funcall evlis (cdr e) a) a))))
                       ((quote t)
                        (funcall apply (car e) (funcall evlis (cdr e) a) a))))))))
      100)
   1000000)
