Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!apple!cambridge.apple.com!alms From: alms@cambridge.apple.com (Andrew L. M. Shalit) Newsgroups: comp.lang.scheme Subject: Re: Macros again Message-ID: Date: 4 Jun 91 20:27:50 GMT References: <1510@yoakum.cs.utexas.edu> Sender: news@cambridge.apple.com Organization: Apple Computer Inc, Cambridge, MA Lines: 30 In-reply-to: jinx@zurich.ai.mit.edu's message of 3 Jun 91 21:49:34 GMT jinx@zurich.ai.mit.edu (Guillermo J. Rozas) writes: >jaffer@zurich.ai.mit.edu (Aubrey Jaffer) writes: > >Local (non-top level) macros seem like a useless gold plated feature... I feel the opposite of what you feel. I think that only local macros are useful and global macros are horrible (although convenient) because of all the problems they present with respect to modularity, separate compilation, etc. When I use macros, I often wrap a LET-SYNTAX (MIT Scheme) around the whole file and all the macros are local. That way I can combine the program with any other and I know that it won't be affected by a macro vs. procedure interaction. It all depends on what size programs you expect to put together. Collisions in the name space become more common the larger the programs become, and at that point you start using lexical scoping (even for macros) more heavily in order to avoid potential problems. I agree with both Jinx and Aubrey. The need for local macros depends a lot on whether you have a module system which is distinct from LET-style binding. If you have a separate module facility, then macros can be scoped at the module level and you don't need LET-SYNTAX. However, if LET and friends are your only way to chunk code, then you probably need something like LET-SYNTAX.