From: Eliot Handelman
Subject: macroexpanding macrolets
Date: 
Message-ID: <4049@idunno.Princeton.EDU>
I need a function that macroexpands locally-defined macros (via MACROLET)
-- is there some way to do this in plain CL? If not, has anyone hacked such a 
tool in KCL? Am I right in thinking that the optional environment to
MACROEXPAND is the way to go? Can the PCL portable code-walker be used
to do this? If so, how? 

Thank you, and have a nice day.

--eliot

From: Vance Maverick
Subject: Re: macroexpanding macrolets
Date: 
Message-ID: <8880@pasteur.Berkeley.EDU>
In article <····@idunno.Princeton.EDU>, ·····@phoenix.Princeton.EDU
(Eliot Handelman) writes:
> I need a function that macroexpands locally-defined macros (via MACROLET)
> -- is there some way to do this in plain CL? If not, has anyone hacked
such a 
> tool in KCL? Am I right in thinking that the optional environment to
> MACROEXPAND is the way to go?

Yes, according to CLtL.  But how do you get the Lisp object representing
an environment?
From: Tim Moore
Subject: Re: macroexpanding macrolets
Date: 
Message-ID: <1990Nov14.135322.7677@hellgate.utah.edu>
In article <····@pasteur.Berkeley.EDU> ········@fir.Berkeley.EDU (Vance Maverick) writes:
>In article <····@idunno.Princeton.EDU>, ·····@phoenix.Princeton.EDU
>(Eliot Handelman) writes:
>> I need a function that macroexpands locally-defined macros (via MACROLET)
>> -- is there some way to do this in plain CL? If not, has anyone hacked
>such a 
>> tool in KCL? Am I right in thinking that the optional environment to
>> MACROEXPAND is the way to go?
>
>Yes, according to CLtL.  But how do you get the Lisp object representing
>an environment?

By using the &environment argument to macros.
Tim Moore                    ·····@cs.utah.edu {bellcore,hplabs}!utah-cs!moore
"Ah, youth. Ah, statute of limitations."
		-John Waters
From: Eliot Handelman
Subject: Re: macroexpanding macrolets
Date: 
Message-ID: <4065@idunno.Princeton.EDU>
In article <·····················@hellgate.utah.edu> ··················@cs.utah.edu (Tim Moore) writes:
;In article <····@pasteur.Berkeley.EDU> ········@fir.Berkeley.EDU (Vance Maverick) writes:
;>In article <····@idunno.Princeton.EDU>, ·····@phoenix.Princeton.EDU
;>(Eliot Handelman) writes:
;>> I need a function that macroexpands locally-defined macros (via MACROLET)
;>> -- is there some way to do this in plain CL? If not, has anyone hacked
;>such a 
;>> tool in KCL? Am I right in thinking that the optional environment to
;>> MACROEXPAND is the way to go?
;>
;>Yes, according to CLtL.  But how do you get the Lisp object representing
;>an environment?
;
;By using the &environment argument to macros.

In answer to my own question, a function containing macrolets can be
expanded using the pcl portable code walker like this (as pointed out
to me by Chris Richardson of Franz):

(pcl::walk-form form)
From: Gregor Kiczales
Subject: Re: macroexpanding macrolets
Date: 
Message-ID: <GREGOR.90Nov16093902@spade.parc.xerox.com>
As someone else mentioned, you want to use the CL code walker
distributed with PCL.  You can FTP all of PCL from arisia.xerox.com.  It
is in the /pcl directory.  The file you really want is walk.lisp, and
there is some documentation there about how to use it.

In a recent (I forget which) issue of Lisp Pointers, Pavel Curtis wrote
had an article describing the issues involved in walking CL code, and
how (a conceptually cleaned up) version of the PCL code walker worked.