[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: common-lisp-object-system@SAIL.STANFORD.EDU
- Subject: Re: standard-type-classes
- From: David A. Moon <Moon@STONY-BROOK.SCRC.Symbolics.COM>
- Date: Fri, 23 Jan 87 14:21 EST
- In-reply-to: <870122-220155-1729@Xerox>
Date: 22 Jan 87 22:03 PST
"Question. Should the same object have the same class (with the same
name) in all standard Common Lisp systems? What do we do about the
float set which has several different classes that may be collapsed.
This seems like a reason to omit (some) implementation dependent
There are a number of examples where it seems clear that we want to make
no such requirement. For example, we don't want to require that
implementations *not* use the class system to implement stream classes,
e.g. (class-of (make-two-way-stream a b)) should not be required to be
the class STREAM but merely STREAM or some subclass of STREAM. I think
the floating point classes are in the same category, i.e., they are
"implementation-dependent classes" and code that discriminates on them
is allowed and implementation-dependent.
I agree. Actually I'd like to strengthen it: to me, class-of is like type-of
and shouldn't be guaranteed portable. Specifically, when the standard says
an object is "of class X", that should -always- mean that class-of the object
is allowed to be a subclass of X.
It's worth pointing out again that the distinction between SINGLE-FLOAT
and DOUBLE-FLOAT is qualititatively different from the distinction between
FIXNUM and BIGNUM. The float types have behavioral differences and
implementations aren't allowed to convert one into the other, with
two exceptions: the clearly defined rules of floating point contagion;
and an implementation is allowed to collapse these into a single type.
FIXNUM and BIGNUM on the other hand are purely implementation types and
behave identically (except for speed).