(defmacro for (var start stop &body body);creates a for loop that mimics c's for, kinda (let ((gstop (gensym)));create a lexically unique variable `(do ((,var ,start (1+ ,var));this is the list that injected into source. (do ((x 1 (1+ x)) (,gstop ,stop));gstop = stop ((> ,var ,gstop));stop when var > gstop ,@body)));else, do body (defmacro in (obj &rest choices);is the first parameter in the remaining parameters (let ((insym (gensym)));lexically unique var. `(let ((,insym ,obj));set the var to what we are searching for (or ,@(mapcar #'(lambda (c) `(eql ,insym ,c));and check to see if obj is in choices by using mapcar choices))))) (defmacro random-choice (&rest exprs);choises one from the list of parameters `(case (random ,(length exprs)) ,@(let ((key -1)) (mapcar #'(lambda (expr) `(,(incf key) ,expr)) exprs)))) (defmacro avg (&rest args);gets the average of the parameters `(/ (+ ,@args) ,(length args))) (defmacro with-gensyms (syms &body body);useful to use in a macro, defines many gensyms. `(let ,(mapcar #'(lambda (s) `(,s (gensyms))) syms) ,@body)) (defmacro aif (test then &optional else) `(let ((it ,test)) (if it ,then ,else))) (deftest test-utility-macros () (let ((total 0)) (check (in 5 1 2 3 4 5 6) (not (in 6 1 2 3 4 5)) (random-choice 'a 'b 'c 'd) (= (avg 1 2 3 4 5) 3) (aif (> (+ 1 2) 2) t nil) )))