(hash-set macs 'if (fn args (cond args (cond (cdr args) (cond (cddr args) `(cond ,(car args) ,(cadr args) (if ,@(cddr args))) `(cond ,(car args) ,(cadr args))) (car args)) nil))) (def map (f things) ; transforms the list 'things by applying 'f to each item ; returns the resulting list (if (pair? things) (cons (f (car things)) (map f (cdr things))) things (f things))) (def hash-cons (h k v) ; push 'v onto the value for 'k in 'h (hash-set h k (cons v (hash-get h k)))) (def rev (things last-cdr) ; 'things - the list to be reversed ; 'last-cdr - (normally nil) - an item (atom, list, nil, anything) to be consed to the end of the reversed list. (if (pair? things) (rev (cdr things) (cons (car things) last-cdr)) last-cdr))