Xref: utzoo comp.lang.lisp:2911 comp.lang.scheme:1163 Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!quiche!utility From: utility@quiche.cs.mcgill.ca (Ronald BODKIN) Newsgroups: comp.lang.lisp,comp.lang.scheme Subject: Re: Correct LisP (was Re: in defense of C) Message-ID: <2452@quiche.cs.mcgill.ca> Date: 12 Mar 90 21:47:54 GMT References: <1942@skye.ed.ac.uk> <14236@cbnewsc.ATT.COM> <12572711825024@AIDA.CSD.UU.SE> <1990Mar12.104518.1412@hellgate.utah.edu> Reply-To: utility@quiche.cs.mcgill.ca (Ronald BODKIN) Followup-To: comp.lang.lisp Organization: SOCS, McGill University, Montreal, Canada Lines: 24 In article <1990Mar12.104518.1412@hellgate.utah.edu> moore%cdr.utah.edu@cs.utah.edu (Tim Moore) writes: >I don't know what Lisps you're refering to, but Common Lisp isn't one >of them. The argument to CAR and CDR is LISTP, which means its either >a cons pair or NIL. How could lists be implemented in some other way? >If some sort of cdr-coding trick or array scheme is used internally in the >implementation, CAR and CDR better still work, or the implementation >is quite broken. > >FIRST and REST are for quiche eaters :-) Or, with only have a smiley, >for non-Lisp programmers who are slumming. The problem with this is that you lose something conceptually. I don't think anyone will ever invent a lisp where lists aren't cons'd together (can you imagine how little extant lisp code would work). However, the author of Anatomy of Lisp, makes a good point that if you are trying to deal with abstract things (e.g. lists) then don't "pun" and say "its really just a ..." The question does arise, however, whether or not car/cdr are invalid peeking or whether or not they are so well established that we can consider them overlloaded. I certainly use them (if only due to the convenience of cXXXr) and if one wasn't to use them, then one would have to replace cons and just about anything which can be used on dotted pairs. The issue gets more emphatic when people start to say "well I know that a window structure is just a list: (x y dx dy textcolor)" and rely on this kind of thing. Ron