[plt-scheme] Is there a general overview of contracts somewhere?

From: Eli Barzilay (eli at barzilay.org)
Date: Sun Apr 17 20:45:05 EDT 2005

On Apr 17, jekwtw wrote:
> 
> Yes, it's pretty clear that CL implementors typically *use* type
> specs as pragmas for efficiency; however, the standard *does* say
> that contexts that violate type specs are absolutely in error, but
> conforming implementations are not *required* to detect the errors.
> Thus there could be high-quality implementations in which type specs
> are taken seriously.

On a Lisp system (I think it's still an imaginary one, no?) you still
don't have the higher-order stuff.


On Apr 17, jekwtw wrote:
> 
> You're right about the usual practice, but I think it's more a
> matter of advantage being taken of a loophole than intent as such.
> As I said in an earlier response, the CL spec says unequivocally
> that contexts that violate a type spec are erroneous; the loophole
> is that an implementation need not detect the errors to be
> conforming.

It's not a loophole if it was put there *intentionally*.


> BTW, since the CL type system "seamlessly" (it says so right here in
> the label :-) integrates CLOS, I believe type specs can be used with
> methods, generic functions, and classes.

They can, but this "seamlessly" is a by-product of having types in
your language.  This is how Swindle exposes primitive types as
classes, and AFAIK, it's done in the same way with CLOS.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!



Posted on the users mailing list.