[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: is of type...
- To: Masinter.pa@Xerox.COM
- Subject: Re: is of type...
- From: Jim Kempf <kempf%hplabsc@hplabs.HP.COM>
- Date: Mon, 16 Mar 87 11:33:32 pst
- Cc: email@example.com
>Its pretty clear that "A is of type B" is defined to mean that A
>can be an instance of some sub-type of B. You assert this is false...
After consulting my dog-eared copy of CLtL, it seems as if
this is the sense in which "is of type" is used in CLtL, and
thus there is no ambiguity between Chapters 2 and 4 and Section
9.2 on DECLARE and 9.3 on THE.
I think the fundamental problem here is that it is not possible
to have instances of types in Common Lisp which are more general
(correct me if I'm wrong), with perhaps the exception of DEFSTRUCTS.
For example, it is not possible to have an instance of INTEGER
which is not either a FIXNUM or a BIGNUM.
With DEFSTRUCTS, it is possible to have an instance of
a type A which is a supertype of type B, so DECLAREing a
variable to be of type A does not preclude B , and thus there
is limited potential for compilation optimization. In stock
Common Lisp, however, this probably isn't a problem, since
passing a STRUCT to a function by reference is probably about
the best you can do.
In CLOS, however, it is a problem, since the application developer
might want to optimize out messaging via a declaration, if
the compiler writer and the language specification have provided