Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!news.kei.com!newsfeed.internetmci.com!howland.reston.ans.net!ix.netcom.com!netcom.com!wnewman
From: wnewman@netcom.com (Bill Newman)
Subject: Re: I was wrong (mea culpa) Re: pair? AND list?
Message-ID: <wnewmanDIGJIF.3qB@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
X-Newsreader: TIN [version 1.2 PL1]
References: <48p0td$pqf@netnews.nctu.edu.tw> <xy7zqdrcf2j.fsf@sans06.nada.kth.se> <48qs6e$s2j@boogie.cs.utexas.edu> <48t16e$eh1@blackrabbit.cs.uoregon.edu> <48tfv1$18s@jive.cs.utexas.edu>
Date: Wed, 22 Nov 1995 18:32:39 GMT
Lines: 25
Sender: wnewman@netcom9.netcom.com

Paul Wilson (wilson@cs.utexas.edu) wrote:

: On the other hand, I still think the name list? is unfortunate.
: The idiom (or (pair? x) (null? x) is so useful and so common that there
: ought to be a standard procedure that does it, and the obvious name
: for it is list?  (Well, it seems obvious to _me_ and some other people
: who've misused list?, anyway.  I've seen people write really slow Scheme
: programs because they used list? on proper lists, thinking it was
: constant-time.)

: This seems unfortunate---the traditional Lisp distinction is nice because
: you can test for list? in constant time, as many of us (both novices and
: old Lispers) would expect;  it's doubtless too late to change, though.

: But it might be nice to add a procedure that does do the expected thing,
: by a different name, so that a casual reading of the standard will make
: it clearer that something possibly unexpected is what's going on.  
: (The obvious name would be pair-or-null?, but that's really awkward.)

(Aha, a can't-pass-this-up chance to post an article with a zillion times 
as much quoted as added text!)

How about (list-head? foo) ?

  Bill Newman
