Paul Tarvydas <paultarvy...@gmail.com> writes:

> 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.


(defmacro this-works-but-it-s-bad-form-to-mix-in-package-with-other-things ()
 (let ((package :xxx))
   `(progn
     (in-package ,package)
     (defun ,(intern "FNAME" package) (x)
        (if (< x 1)
            1
            (* x (,(intern "FNAME" package) (1- x))))))))



-- 
__Pascal Bourguignon__
http://www.informatimago.com/
"Le mercure monte ?  C'est le moment d'acheter !"

Reply via email to