Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!mcsun!ukc!edcastle!aiai!jeff From: jeff@aiai.ed.ac.uk (Jeff Dalton) Newsgroups: comp.lang.scheme Subject: Re: Why macros impair readability Message-ID: <4291@skye.ed.ac.uk> Date: 9 Mar 91 21:49:19 GMT References: <9103071300.aa28959@mc.lcs.mit.edu> Reply-To: jeff@aiai.UUCP (Jeff Dalton) Organization: AIAI, University of Edinburgh, Scotland Lines: 36 In article <9103071300.aa28959@mc.lcs.mit.edu> lyn@altdorf.ai.mit.EDU (Franklyn Turbak) writes: >I agree wholeheartedly; my definition of "readability" *is* weak and not >very useful. However, it's the only one I could think of at the time >of writing that allowed me to raise the set of points I wanted to raise: >that macros complicate reasoning about order of evaluation, static scope, >first-classness, and debugging. There was a much easier solution, namely to raise those points without trying to tie them to the definition of readability. >I'd rather have a much stronger notion of readability that more people >find in tune with their intuitions. From the discussions so far, >there's a lot of people who *do* feel that macros can make programs >hard to read. My goal is to understand better *why* they feel this >way. I'd agree with that. But one reason is that macros are often written as fairly complex list structure manipulations. Backquote helps some, extend-syntax much more. There are a number of simple reasons like this, that don't require a deep analysis. >I am working on an improved model of "readability" to better handle >your objection. The basic idea is that macros are harder than >procedures for the reader to model behaviorally because of the various >funky things that can be done in complex desugarings. N.B. _can_ be done. The complaints ought to be about the funky things. Note too that a desugaring can be complex without the macro being hard to understand if it implements a well-defined, easy to manage abstraction. For example, I can understand list comprehensons in Haskell more easily than I can understand the desugaring.