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

Issue: COERCE-INCOMPLETE



a) the definition of COERCE says that "If {\arg object} is already of {\arg
result-type} (as determined by 
{\function typep}), {\arg object}
is returned. Copying of {\arg object} is not necessary."

Should this say "is not performed"? That is, 
(when (typep x y) (assert (eql x (coerce x y))))

for all objects x, for all valid type specifiers y?

Are there any implementations that do copy any types?

I think the specification of COERCE will be clearer if the operation is
described sorted by type specifier rather than by the type of the object. I
think that's how most implementations work. However, the description starts
out talking about the type of "object" and only then talks about the type
specifiers.

Certainly this is a "multi-method", but the resolution is right-to-left
rather than left-to-right, I think.

Does COERCE work for types that are DEFTYPEd? I.e.,

(DEFTYPE FROB () '(VECTOR (SIGNED-BYTE 3)))
(COERCE X 'FROB)?

The Problem Statement is that Coerce is incomplete and confusing. We may
not need to change the language to fix the problem, but we certainly need
to clear up the description.