
14 Mar
2014
14 Mar
'14
4:57 p.m.
Paul Tarvydas <paultarvydas@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 !"