home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!caen!uflorida!travis.csd.harris.com!grouper!!brent
- From: brent@ssd.csd.harris.com (Brent Benson)
- Newsgroups: comp.lang.scheme
- Subject: Re: What's the story with ATOM??
- Message-ID: <BRENT.92Dec15100927@amber.ssd.csd.harris.com>
- Date: 15 Dec 92 15:09:26 GMT
- References: <1992Dec15.070322.28439@pasteur.Berkeley.EDU>
- Sender: news@grouper.mkt.csd.harris.com (Network News)
- Organization: Harris Computer Systems
- Lines: 32
- In-Reply-To: matt@volga.Berkeley.EDU's message of Tue, 15 Dec 1992 07:03:22 GMT
-
- matt@volga.Berkeley.EDU (Matt Wright) writes:
-
- > ... The Book says it's just anything that's not a pair... EdScheme
- > thinks '() isn't an atom (contrary to The Book...)
-
- This is not contradictory, the empty list is not pair. The empty list
- is both an atom and a list.
-
- > What's the story on this? Do people (e.g., implementors) have
- > rationales for doing it a particular way? To me, (lambda (x) (not
- > (pair? x))) makes sense, but on the other hand, it's weird to me
- > that a vector is an atom; I'd rather think of a pair as a vector of
- > length two than of a vector as an atom.
-
- > Do people think this should be in the standard (non-essential, I
- > would think)? Or should I just never use it?
-
- In my opinion, the atom/pair distinction is useful when dealing with a
- small subset of the Scheme data types (symbols, number and pairs), and
- for pedagogical purposes, but not very useful for programming in the
- large, primarily because of the presence of a greater variety of types
- (characters, vectors, strings, etc.).
-
- If you want to now if something is a symbol, use symbol?. If you want
- to now if something is a number or a symbol, use (or (symbol? obj)
- (number? obj)). If you want to now if something is not a pair, use
- (not (pair? obj)). Otherwise, you end up trying to force a square peg
- into a round hole.
-
- --
- Brent Benson
- Harris Computer Systems
-