Xref: utzoo comp.lang.lisp:3721 comp.lang.scheme:1732 Path: utzoo!attcan!uunet!mcsun!ukc!edcastle!aiai!jeff From: jeff@aiai.ed.ac.uk (Jeff Dalton) Newsgroups: comp.lang.lisp,comp.lang.scheme Subject: Re: Virtues of Lisp syntax (a tangent on macros and Scheme) Message-ID: <3453@skye.ed.ac.uk> Date: 26 Sep 90 14:11:20 GMT References: <10722@life.ai.mit.edu> <1990Sep20.170311@ai.mit.edu> <1990Sep20.234752.19591@cbnewsc.att.com> Reply-To: jeff@aiai.UUCP (Jeff Dalton) Organization: AIAI, University of Edinburgh, Scotland Lines: 52 In article <1990Sep20.234752.19591@cbnewsc.att.com> lgm@cbnewsc.att.com (lawrence.g.mayka) writes: >In article <1990Sep20.170311@ai.mit.edu>, tmb@ai.mit.edu (Thomas M. Breuel) writes: >> * In a language like Scheme (as opposed to CommonLisp) >> that provides efficient implementations of higher order >> constructs with natural syntax, there is little need or >> excuse for something as horrible as LOOP in the first >> place. I think this ritual Common Lisp bashing is becoming a bit of a bore, don't you? The truth is that I can easily write a named-let macro in Common Lisp and write a large class of loops in exactly the way I would write them in Scheme. The efficiency isn't bad either, because most CL compilers can optimize self-tail-recursion for local functions. (Yes, I know Scheme does better than that.) Moreover, if I want something like the Abelson & Sussman COLLECT macro for streams I can write it in portable Common Lisp. I would argue that code using such macros is significantly easier to understand that the same thing done with nested recursive loops or nested calles to MAP-STREAM and FLATMAP. Until Scheme has a standard way of writing macros, I can't write such things in portable Scheme. So I am very much in favor of having such a standard mechanism for Scheme. Of course, if you prefer higher-order functions instead of macros, there is already a large set of them available in Common Lisp (MAPCAR, SOME, REDUCE, etc.) and it is easy to write more. So (1) Scheme's advantages over Common Lisp is this area, while real and significant, are not as great as one might suppose, and (2) there are iteration macros that are worth having regardless of one's views on LOOP. >We can talk about Dick Waters' SERIES package instead, if you prefer. Yes, let's. I don't expect Scheme folk to flock to this beastie, but it does show one of the benefits of having macros, namely that it enables such work to be done. Moreover, one of the arguments for Scheme, I would think, is that anyone doing such work in Scheme would be encouraged by the nature of the language to look for simple, general, "deep" mechanisms rather than the relatively broad, "shallow" mechanisms that would fit better in a big language such as Common Lisp. (This is not to imply that the Series package is shallow or in any way bad (or even that shallow in this sense is bad). Anyway, I'm speaking in general here and no longer taking Series as my example.) -- Jeff