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

Random metaclasses for CL types



    Date: Thu, 11 May 89 06:28:56 PDT
    From: Jon L White <jonl@lucid.com>

    re: . . . or any other implementation-defined
	class that is no more restrictive than a {\bit built-in class\/}.

    I liked your first version better -- I don't remember  88-002R having
    a well-ordered scale for "restrictiveness" of metaclasses, so this
    phrase (for me) causes much more confusion than it clears up.  But
    it's not a big point.

"restrictive" refers to the immediately following paragraph in 88-002R,
which documents the restrictions of built-in-class.  The idea is that
if a user program assumes it might be a built-in-class, an implementation
can't screw the user over by coming with an implementation-defined class 
that's even worse (can't appear as the cdr of a cons or something).

How about changing "is no more restrictive" to "has no more restrictions"?
Kathy?

    On a related theme -- I was wondering if everyone agrees that the
    following is also permitted by "Integrating Types And Classes" section.
    An implementation may have a subset of some built-in class being 
    implemented by a different meta-class than the rest of the set.

1-16 says additional type specifiers can have classes, so I think
everyone agrees that the built-in classes can have implementation-defined
subclasses.  I assume the metaclass of those can be anything that works.

    For example, in most implementations we probably have:

       (class-name (class-of (find-class 'integer))) --> BUILT-IN-CLASS

    But some implementation might also have a FIXNUM class such that:

       (class-name (class-of (find-class 'fixnum))) --> FAST-ARITH-CLASS

    where FAST-ARITH-CLASS is not a subclass of BUILT-IN-CLASS.  Of course, 
    the FIXNUM class is a still a subclass of INTEGER.

I can't understand why FAST-ARITH-CLASS wouldn't be a subclass of
BUILT-IN-CLASS.  Maybe the example you really meant was

       (class-name (class-of (find-class 'integer))) --> SLOW-ARITH-CLASS
       (class-name (class-of (find-class 'fixnum))) --> FAST-ARITH-CLASS

where SLOW-ARITH-CLASS and FAST-ARITH-CLASS are disjoint subclasses
of BUILT-IN-CLASS?

    [don't take this example too seriously -- I'm more concerned about
    subclasses of the FUNCTION class.]

Or maybe you really meant that 
       (class-name (class-of (find-class 'function))) --> BUILT-IN-CLASS
but
       (class-name (class-of (find-class 'generic-function))) --> FUNCALLABLE-STANDARD-CLASS
and
       (subclassp 'FUNCALLABLE-STANDARD-CLASS 'BUILT-IN-CLASS) --> NIL
which is specified either by 88-002R or the draft metaobject protocol,
I forget which.  Anyway this example shows that you don't have to worry.