Xref: utzoo comp.lang.lisp:2907 comp.lang.scheme:1161 Path: utzoo!attcan!uunet!mailrus!uwm.edu!cs.utexas.edu!hellgate.utah.edu!cdr.utah.edu!moore From: moore%cdr.utah.edu@cs.utah.edu (Tim Moore) Newsgroups: comp.lang.lisp,comp.lang.scheme Subject: Re: Correct LisP (was Re: in defense of C) Message-ID: <1990Mar12.104518.1412@hellgate.utah.edu> Date: 12 Mar 90 17:45:18 GMT References: <1942@skye.ed.ac.uk> <14236@cbnewsc.ATT.COM> <12572711825024@AIDA.CSD.UU.SE> Organization: University of Utah CS Dept Lines: 29 In article <12572711825024@AIDA.CSD.UU.SE> D89.JOHNNY-BILLQUIST@AIDA.CSD.UU.SE (Johnny Billquist) writes: >In article <14112@cbnewsc.ATT.COM> lgm@cbnewsc.ATT.COM (lawrence.g.mayka,ihp,) writes: >The correct argument to CAR and CDR is *not* lists, but >s-expr (punctuated pairs to be specific). The fact that most >(if not all) LisPs implement lists by punctuated pairs >is a feature you should not rely upon. That is why the >functions FIRST and REST exists. Sure, they do just CAR >and CDR, but what if you stumles upon a LisP which implement >lists in another way? If you should do it *really* right, >CAR and CDR should not be able to work on lists at all, >however convenient it might be. > >Anybody who cares to flame can do it to me personally. 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. >D89.JOHNNY-BILLQUIST@AIDA.CSD.UU.SE Tim Moore moore@cs.utah.edu {bellcore,hplabs}!utah-cs!moore "Ah, youth. Ah, statute of limitations." -John Waters