(defmacro for (var start stop &body body) (let ((gstop (gensym))) `(do ((,var ,start (1+ ,var)) (,gstop ,stop)) ((> ,var ,gstop)) ,@body))) (defmacro in (obj &rest choices) (let ((insym (gensym))) `(let ((,insym ,obj)) (or ,@(mapcar #'(lambda (c) `(eql ,insym ,c)) choices))))) (defmacro avg (&rest args) `(/ (+ ,@args) ,(length args))) (deftest test-macro-utilities () (check (equalp (format t "1234") (for x 1 4 (princ x))) (equalp 't (in (car '(* 9 1 4 6)) '+ '- '*)) (= '2 (avg 1 2 3))))