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

Re: Issue: COERCE-INCOMPLETE (Version 2)



I am bothered by the addition of various bizarre types to the type system
just so that coerce can do its thing.  Are these "real" types?  If so, what
do they mean in a declaration?  If not "real", then why do we call them types?

ACCESSIBLE-SYMBOL seems especially twisted.  The use of the "current
package" is the most problematical.  What is the "current package" for a
declaration?

Especially in a language with dynamic typing, the boundary between "type"
and "value" tends to blur, but I think that this proposal uses the Common
Lisp type system in a way that isn't very type-like.  I am very suspicious
of any type that must be defined using SATISFIES.

I also wonder about INTEGRAL-FLOAT.  To say that a float has "no fraction"
is meaningless, or at least confusing.  I think that you really mean that
the remainder is 0.0 when you truncate it, but it is unclear how you are
going to tell this other than by doing the truncation.  If you do the
truncation, you have the result anyway, so why call COERCE?

I think that in general, it is treacherous to support symmetric coercion
for any pair of types where the coercion in either direction is information
losing.  This also applies to all the symbol coercions.

The dependence on TYPE-OF is also bothersome.  Any clarafication of TYPE-OF
isn't really a clarification of TYPE-OF, it is a clarification of the legal
run-time type systems in a Common Lisp implementation.  I consider the
function performed by TYPE-OF to be very troublesome from a language design
perspective, and I would rather people didn't depend on it.

Also, there is an error in the approximate definition for CHAR-INT.  It
should be something like:

	  (DEFTYPE CHAR-INT ()
	    `(INTEGER 0
		      ,(CHAR-INT
			(CODE-CHAR (- CHAR-CODE-LIMIT 1)
				   (- CHAR-BITS-LIMIT 1)
				   (- CHAR-FONT-LIMIT 1)))))


  Rob