macro returning more than one form

Alessio Stalla alessiostalla at gmail.com
Fri Mar 14 15:58:20 UTC 2014


At the top level, PROGN is treated as if each contained expression appeared
at the top level. So generally wrapping a PROGN around the result is
precisely what you need to do.

However, since I see an IN-PACKAGE form in your example... beware that that
IN-PACKAGE form will NOT affect the following DEFUN, because the symbols in
it will have been read long before the IN-PACKAGE is executed.


On Fri, Mar 14, 2014 at 4:45 PM, Paul Tarvydas <paultarvydas at gmail.com>wrote:

> What is the best way to write a macro that returns more than one form to
> the top level?  E.g.
>
> (in-package :xxx)
> (defun ...)
>
> I've been wrapping a progn around the result, but LW doesn't like it very
> much, and SBCL seems to hate it.
>
> Thanks
> pt
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/pro/attachments/20140314/1b64ddf7/attachment.html>


More information about the pro mailing list