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

Type-checking of slot values

Reference: pages 1-13 and 2-23 of 20 Jan 88 draft.
CLtL p.158, p.310, p.6.

Sometime between August and November the definition of the :type
slot option was changed from "An implementation may or may not
choose to check the type of the new value when initializing or
assigning to a slot" to "An implementation is required to check
the type of the value being stored in a slot only under the safest
compiler safety setting and in the interpreter."  I don't think
this change was every publically discussed.

Perhaps this is my bias that type declarations are only a crutch for
crippled machines showing, but I don't think this change was
appropriate.  It is not consistent with CLtL's definition of the
:type slot option in defstruct and the type declaration for variables.
Violation of these type constraints "is an error."

It's perfectly legitimate to argue against the current definition of
type declarations in Common Lisp.  I have no problem with that.
However, I don't think it's appropriate for this issue to be decided
by CLOS rather than by CL, nor do I think it a good idea for type
declarations in CLOS to have different semantics from type declarations
in the rest of CL.

I feel the definition of CLOS's :type slot-option must be changed back,
unless there is an agreed upon change to Common Lisp to accompany it.