A Lisp implemented in AWK
;; Some version of the tak benchmark, as found in Nils Holm's _Lisp
;; from Nothing_. He dedicated the code in the book to the public
;; domain.

(label
 ((six (quote (1 2 3 4 5 6)))
  (twelve (append six six))
  (eighteen (append six twelve))

  (ltak (lambda (x y z)
          (cond ((not-longer x y) z)
                (true (ltak (ltak (cdr x) y z)
                            (ltak (cdr y) z x)
                            (ltak (cdr z) x y))))))
  (not-longer (lambda (a b)
                (cond ((eq nil a))
                      ((eq nil b) nil)
                      (true (not-longer (cdr a) (cdr b))))))
  (ntimes (lambda (n)
            (cond ((null n))
                  (true (print (ltak eighteen twelve six))
                        (ntimes (cdr n)))))))
 (ntimes (quote (1 2 3 4 5 6 7 8 9 10))))