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

Re: Proposal #7 Status: TYPE-SPECIFIER-P



    Date: 28 Jul 86  1301 PDT
    ......
    From:
    Subject: Re: Proposal #7 Status:  TYPE-SPECIFIER-P
    In-reply-to: "Scott E. Fahlman" <Fahlman@C.CS.CMU.EDU>'s message of Sun,
     27 Jul 86 21:44 EDT
    ......    
    On some further thought,  TYPE-SPECIFIER-P is ambiguous in some cases
    where the argument is a symbol: 
    Suppose you have
    
    (deftype relatively-prime-to (n) `(satisfies (lambda (x) (= 1 (gcd x
    ,n)))))
    
    In this case, relatively-prime-to by itself is not "a valid type
    specifier". 
    (relatively-prime-to 10) is a valid type specifier, and
    (relatively-prime-to t) is not.

Your point about deftype can be looked at differently.
If I have a deftype, i.e., (deftype mod (n) ...) etc. then
"mod" is a parameterized type.

The polymorphic lambda calculus has abstraction and 
beta reduction defined for types, so following its example, the
type of "mod" might be (type-lambda (n) <type-expression in n>), where
type-lambda is the type abstraction.

In the light of this, (type-specifier-p 'relatively-prime-to) should
be true (independent of whether we add any type-abstraction notations to CL).

{ aside:: By the way, the polymorphic lambda calculus is fairly
interesting, so for those of you interested in fixing up the type
system, I suggest you look at it carefully.  If you want, send me
mail (NO NOT TO THE CL MAILING LIST!!) and I will send some
references. :-) }

Any attempt to make type-specifier-p tell you whether a type specifier 
specifies any real class of objects cannot work due to undecidability 
problems. What we want is a SYNTACTIC property.

    Is the intent "is this something I can hand to typep?" If so, it would
    be false for "relatively-prime-to". If the intent is "does this *name* a
    type-specifier" then we could allow it, but the usefulness of such a
    thing is unclear to me.

Note that (typep 'relatively-prime-to...) should be invalid, since 
'relatively-prime-to is not a type, but it IS a valid specifier.
Note, there are no objects of type (type-lambda (n) ...) since those
objects would be TYPES, not instances of types.
    
    .....
    
    d) of all of the proposals to consider, proposals to add new constructs
    should get much lower priority than those to clarify or standardize
    current constructs.

Amen.
I just think we should plan to revise the type system somewhat, instead of 
just adding features. I agree that this is fairly low priority, and in
the light of...
    e) there is another proposal (before the Object Oriented Programming
    committee in this case) which satisfies  at least part of the original
    requirement in a different way.

Most object-oriented stuff impacts the type system dramatically, so 
we should reexamine the type-system in light of object oriented extentions.

...mike beckerle
Gold Hill Computers