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

(SYMBOL? #t) ==> ?



    Date: Fri, 11 Mar 88 12:31:28 PST
    From: andy%hobbes at ads.com (Andy Cromarty)

    This suggests that if v is a vector and p a pair, then (VECTOR? v) and
    (PAIR? p) should be true, but (VECTOR? p) and (PAIR? v) should be
    undefined in the Report (i.e. considered to be implementation-dependent).

I knew this topic would spark a lively debate.

As I understand your message, you are saying that a Scheme
implementation in which, say, ALL type predicates returned #T ALWAYS,
would be a correct one.  For example, it could be the case that (symbol?
'(a b)) => #t and (pair? 'a) => #t.  (I guess it would also have to have
no type errors, but that's a detail.)  It seems to me that this makes
the type predicates nearly useless.  In that case, they should be
eliminated from the language, making Scheme more like ML (and C and
FORTRAN and ...).  Then to make up for this absence, we should have
strong typing.

I think this would break a lot of programs and annoy many users.

I am not an opponent of subtyping or of abstract data types.  I
certainly don't want to promote a notion of "the type of" an object,
since an object can have many types.  All I am suggesting is that we
specify some set of circumstances in which the type predicates will
return false.  We all make some assumptions implicitly now; I just want
the report to codify existing practice.  Language like that in CLtL
would be fine -- take a look at it, you'll notice that some things are
left unspecified -- but I would hope for something a little tighter.