(cond ((null x) acc)
((atom x) (cons x acc))
(t (flatten (car x) (flatten (cdr x) acc)))))
+
+(defmacro aif (test-form then-form &optional else-form)
+ `(let ((it ,test-form))
+ (if it ,then-form ,else-form)))
+
+(defmacro once-only ((&rest names) &body body) ;; the version from PCL
+ (let ((gensyms (loop for nil in names collect (gensym))))
+ `(let (,@(loop for g in gensyms collect `(,g (gensym))))
+ `(let (,,@(loop for g in gensyms for n in names collect ``(,,g ,,n)))
+ ,(let (,@(loop for n in names for g in gensyms collect `(,n ,g)))
+ ,@body)))))