;;;; Alleviate deep nesting. Suggestions for a better name are welcome. ;;;; ;;;; An example will explain this far better than i can with words, so: ;;;; ;;;; (with* ;;;; (let ((*special* '())) (declare (special *special*))) ;;;; (dolist (a a-list)) ;;;; (with-slots (foo bar baz) a) ;;;; (multiple-value-bind (c d e) (process baz)) ;;;; (progn ;;;; body)) ;;;; ==> ;;;; (let ((*special* '())) ;;;; (declare (special *special*)) ;;;; (dolist (a a-list) ;;;; (with-slots (foo bar baz) ;;;; a ;;;; (multiple-value-bind (c d e) ;;;; (process baz) ;;;; body))))
(defmacro with* (&body body) (cond ((cddr body) (append (first body) `((with* ,@(cdr body))))) ((cdr body) `(,@(first body) ,(second body))) (body (first body)) (t nil)))