Path: utzoo!mnetor!uunet!husc6!cmcl2!rutgers!bellcore!tness7!ninja!pollux!ti-csl!mips!gateley From: gateley@mips.csc.ti.com (John Gateley) Newsgroups: comp.lang.lisp Subject: Re: Common Lisp Macro Expander Wanted Message-ID: <46438@ti-csl.CSNET> Date: 10 Apr 88 02:27:34 GMT References: <49@spar.SPAR.SLB.COM> <23539@ucbvax.BERKELEY.EDU> Sender: news@ti-csl.CSNET Reply-To: gateley@mips.UUCP (John Gateley) Organization: TI Computer Science Center, Dallas Lines: 19 In article <23539@ucbvax.BERKELEY.EDU> larus@paris.Berkeley.EDU.UUCP writes: >How about: > > (defun macroexpand-all (f) > (cond ((atom f) f) > ((and (symbolp (car f)) (macro-function (car f))) > (macroexpand-all (macroexpand f))) > (t (mapcar #'macroexpand-all f)))) > > >/Jim >larus@ginger.Berkeley.EDU >ucbvax!larus Almost works, but you have to check special forms to make sure that they are macro expanded only in the proper places, and then there is always lambda to deal with. (Hint: Dont macro expand the argument list for lambdas, and the same is true for the variables in a let). I cant find anything in CLtL which verifies this, but I think this is correct.