Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!newsfeed.internetmci.com!swrinde!sdd.hp.com!hplabs!hplntx!hplntx.hpl.hp.com!gjr
From: gjr@hplgr2.hpl.hp.com (Guillermo (Bill) J. Rozas)
Subject: Re: null? vs zero?
Sender: news@hpl.hp.com (HPLabs Usenet Login)
Message-ID: <GJR.96Mar20105249@hplgr2.hpl.hp.com>
In-Reply-To: blume@zayin.cs.princeton.edu's message of 19 Mar 1996 14:34:30 GMT
Date: Wed, 20 Mar 1996 18:52:49 GMT
Reply-To: gjr@hpl.hp.com
References: <SPOT.96Mar15200113@sandoz.slip.cs.cmu.edu> <4ij17q$b2j@sifon.cc.mcgill.ca>
	<SPOT.96Mar18170504@sandoz.slip.cs.cmu.edu>
	<GJR.96Mar18173433@hplgr2.hpl.hp.com>
	<BLUME.96Mar19093430@zayin.cs.princeton.edu>
Nntp-Posting-Host: hplgr2.hpl.hp.com
Organization: Hewlett-Packard Laboratories, Palo Alto, CA
Lines: 40

In article <BLUME.96Mar19093430@zayin.cs.princeton.edu> blume@zayin.cs.princeton.edu (Matthias Blume) writes:

|   Of course, as you all know by now :-), I consider types to be
|   something *static* -- properties that will be verified at compile time.
|   In this a world "type predicates" become the equivalent of (K #t)
|   (i.e., the constant function that always returns true), because if any
|   of them were ever to return false this would have been caught and
|   rejected at compile time.

So ML lists do not have to be checked for NULL-ness?  The compiler
catches that statically.  Wow!  :-)

You are defining the problem away.  You are saying that a type is that
which a (particular) type checker checks for.  It is a consistent
definition, but also a circular one.

To me a type is a set of _objects_ (a loaded term).  In particular,
this means that membership is not time-variant, since object identity
is not time-variant.  What do I mean by this?  Merely that if one
object is of some type now, it will continue to be of that type for
ever, no matter what the future course of the computation.  Similarly
if it is not of that type now, it will never be.

A type predicate is merely the (boolean) support function for the type set.

Thus NULL?, PAIR?, ZERO?, VECTOR?, EVEN? etc. are type predicates.

However, LIST? is not (thanks to SET-CDR!), nor the following procedure

    (lambda (v)
      (and (>= (vector-length v) 2)
	   (eq? (vector-ref v 0)
		(vector-ref v 1))))

At any rate, I was only pointing out that your previous post, where
you apparently claimed that ZERO? checked for identity with a
particular object was incorrect.  ZERO? in Scheme is a type predicate
(according to my definition), since there (to my knowledge) are no
mutable numbers, but the zero-set is not a singleton.

