Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cme!cam!ARTEMIS From: miller@GEM.cam.nist.gov (Bruce R. Miller) Newsgroups: comp.lang.lisp Subject: Re: Terminology and style (was Re: Question about INTERN) Message-ID: <2875365341@ARTEMIS.cam.nist.gov> Date: 12 Feb 91 16:35:41 GMT References: <4092@skye.ed.ac.uk> Sender: news@cam.nist.gov Followup-To: comp.lang.lisp Organization: NIST - Center for Computing and Applied Mathematics Lines: 40 In article <4092@skye.ed.ac.uk>, Jeff Dalton writes: > In article <1991Jan30.225106.26561@Think.COM> barmar@think.com > (Barry Margolin) makes some good comments about EQUAL vs EQ, SETF vs SETQ > > This is good advice, but unfortunately certain widely-used textbooks > do such things as (1) use EQUAL everywhere to avoid explaining the > difference between EQUAL, EQL, and EQ; (2) claim that SETQ (and CAR > and CDR) are "old fashioned" and seldom used. Redundancy or not, there are many ways to get the same thing done in Lisp. A personal annoyance of mine is Charniak,etal. Artificial Intelligence Programming (2nd ed, which is in CL). It was interesting to see thier code for `reinventing' loop. But, to me, VERY annoying to have to remember yet another iteration syntax while reading the rest of the book. Granted, the status of LOOP was not clear when they were writing, and too involved to include in the text. Still... Its otherwise a very good text. > My question is this: is it really the case that CAR and CDR are > normally replaced by FIRST and REST in current programming practice? > How about COND, for which the claim has also been made? I can only speak for myself, but here's my vote: I use FIRST, SECOND, & REST for destructuring when I want to emphasize the `flat' structure of the list, that is, when the list represents some (possibly ordered) sequence of `like' entitities. I use CAR, CDR, CxxR, etc, to emphasize a more tree-like structure. If in the latter case, the various places have some kind a distinct meaning (and if its being used `enough'), then I'm inclined to define a set of accessor macros, or even a defstruct. > Theer may be an sociologically interesting process here, one in > which practice is changed by describing it as having changed already > (assuming that programmers who learn Lisp from those texts go on to > program in the style they've been taught). I can believe that! Look at the whole `Lisp is dead' debate. What is the single most effective thing that is killing lisp [to the extent that it actually IS dying]? The statement that Lisp is Dead!!!!!