Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!ames!uhccux!munnari.oz.au!murtoa.cs.mu.oz.au!ditmela!latcs1!jacob From: jacob@latcs1.oz.au (Jacob L. Cybulski) Newsgroups: comp.lang.scheme Subject: Re: (atom? '()) => #t Message-ID: <7385@latcs1.oz.au> Date: 9 Mar 90 01:08:43 GMT References: <1990Mar7.194937.1421@sun.soe.clarkson.edu> Organization: Comp Sci, La Trobe Uni, Australia Lines: 28 In article <1990Mar7.194937.1421@sun.soe.clarkson.edu>, jk0@sun.soe.clarkson.edu (Jason Coughlin) writes: > Can someone explain the rationale behind treating '() as an atom? It > seems to me that it should be a pair: it's the empty *list* not the > empty *atom*. > When you look at lists from a purely functional point of view then any list is the result of CONS, whereas () is a primitive object, thus an atom. A good example of this approach was given in Abelson, Sussman and Sussman's book, where CONS, CAR and CDR are implemented functionally as follows :- (define (cons x y) (define (dispatch m) (cond ((= m 0) x) ((= m 1) y) (else (error "Arg not 0 nor 1 -- CONS" m)))) dispatch) (define (car z)(z 0)) (define (cdr z)(z 1)) As you can see () does not even appear anywhere in this definition, it may be viewed as a constant which customarily appears at the end of the sequencs of pairs (which we call a list). Jacob o | o \_/