Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!think.com!mintaka!ai-lab!zurich.ai.mit.edu!jaffer From: jaffer@zurich.ai.mit.edu (Aubrey Jaffer) Newsgroups: comp.lang.scheme Subject: Re: Macros again Message-ID: Date: 3 Jun 91 21:08:45 GMT References: <1510@yoakum.cs.utexas.edu> Sender: news@ai.mit.edu Organization: M.I.T. Artificial Intelligence Lab. Lines: 23 In-reply-to: wilson@cs.utexas.edu's message of 3 Jun 91 16:29:59 GMT As I look towards implementing macros in scm, a few questions occur to me: I was planning to replace every invocation of a macro in the code with the expansion of the macro. Is there any problem with this? I consider macros to be new derived expression types. Since, according to the definition, derived expression types can be replaced with the expansions, this seems the natural thing to do with macros. Local (non-top level) macros seem like a useless gold plated feature that will introduce problems with use of symbols in programs. Scheme defined keywords are not allowed to be used as variable names. It seems a reasonable expectation that macro names also not be allowed as varible names. But local macros would seem to require that the local macro names could be used elsewhere as variables. All the examples I have seen so far of local macros are contorted and hard to read. Can anyone come up with a really useful example of a local macro? It seems to me that the quickest way to test and disseminate a new macro proposal is to write code which reads in a scheme program containing macros and writes out a new program with the macros expanded. This would be compatible with every scheme implementation. Has this been done? Can it be done?