Subject: Re: Newby question - Hygenic macros vs. other kinds From: Erik Naggum <cl@naggum.no> Date: 1998/05/18 Newsgroups: comp.lang.lisp Message-ID: <3104468057193540@naggum.no> * Martin B. Pomije | I'm teaching myself CL and Scheme. I was reading the Scheme language | definition (Revised^4 Report on the Algorithmic Language Scheme) when I | came across the phrase "hygenic macro", somehow implying that CL is | "unclean" in this regard. What makes makes Scheme macros such pure | things? Barry Margolin has answered with the reasons why you need it, but Kent Pitman posted an article some time ago (1998-03-20) that shed light on why this is a serious problem in Scheme and no big deal in Common Lisp. it's message-id is <sfwiupa3x5n....@world.std.com>¹ in reply to my question in <3099315988158...@naggum.no>². (you should be able to find them on Dejanews or other USENET search engines, too.) in brief, Scheme has only one namespace, and the first element of an s-expression is evaluated to obtain the function to call or the special form. this means you run into a serious danger of using _functions_ that have their meanings changed by the body of code into which the macro expansion is "inserted". clearly, this is bad, but it's a design choice in Scheme with many qualities, so they had to find a way to deal with it. the way I see it (after reading and appreciating Kent's article) is that Scheme allows a level of pollution that is unhealthy and then they need a way to clean up, or things get "unhygienic" around them. Common Lisp is hygienic _enough_ on its own since it doesn't pollute its namespaces to begin with, and therefore need a simpler mechanism for variable capture. #:Erik ------- ¹ src.naggum.no/lisp/news/sfwiupa3x5n....@world.std.com (http/ftp) ² src.naggum.no/lisp/news/3099315988158...@naggum.no (http/ftp) -- "Where do you want to go to jail today?" -- U.S. Justice Department's Windows 98 slogan