src/: Wrap functionish bodies in an appropriately named `block'.
[sod] / src / module-proto.lisp
index 9c7fcaf..dcf8d7c 100644 (file)
 
    When `clear-the-decks' is called, the BODY will be evaluated as a progn.
    The relative order of `clear-the-decks' operations is unspecified."
-  `(add-clear-the-decks-function ',name (lambda () ,@body)))
+  (multiple-value-bind (docs decls body) (parse-body body)
+    `(add-clear-the-decks-function ',name (lambda ()
+                                           ,@docs ,@decls
+                                           (block ,name ,@body)))))
 
 (export 'clear-the-decks)
 (defun clear-the-decks ()