[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NULL?



|   From: Kent Pitman <kmp@harlequin.com>
|   Date: Tue, 7 Jan 97 20:54:58 EST
|   Cc: rrrs-authors@martigny.ai.mit.edu
|   
|      Date: Tue, 7 Jan 1997 20:44:03 -0500
|      From: Guillermo J. Rozas <gjr@martigny.ai.mit.edu>
|   
|      Furthermore, NULL? is listed as a library procedure, rather than a
|      primitive.  This leads me to believe that the implied implementation
|      is 
|   
|          (define (null? obj)
|   	 (and (not (boolean? obj))
|   	      (not (symbol? obj))
|   	      (not (char? obj))
|   	      (not (vector? obj))
|   	      (not (procedure? obj))
|   	      (not (pair? obj))
|   	      (not (number? obj))
|   	      (not (string? obj))
|   	      (not (port? obj))))
|   
|      This strikes me as somewhat ugly (in its asymmetry -- why pick on the
|      empty list) and potentially bad.
|   
|   Is there some reason that 
|   
|     (define (null? obj) (eq obj '()))
|   
|   won't suffice?

You are right of course.  I've been away from Scheme too long. :-(

Now seriously.  Given that eq? is already specified in a funny way, I'd
hate to leave other stuff to be defined in terms of it.

|   I happen to hate the idea of something like this being unspecified.
|   Seems to me the worst of all possible worlds.  But I don't see this
|   as the central issue.
|   

I agree.  My first reaction was, gee, can the empty list be a port or
a vector?  If not, what type is it?  The section on lists says "The
empty list is a special object of its own type (it is not a pair)",
but this is hidden elsewhere and not particularly explicit.

I guess I find it funny that all other objects implied by the report
(with the possible exception of environments, but that was left
deliberately vague) are classified by the predicates in this list, and
I find this disturbing.