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

From: Alexander Schmolck (a.schmolck at gmx.net)
Date: Tue Apr 19 16:03:24 EDT 2005

Matthias Felleisen <matthias at ccs.neu.edu> writes:

>> 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.
> Do you know of one? -- Matthias

How about sbcl?

Cmucl will also issue compile time warnings in situations like this:

    (defun f (x)
      (declare (type (mod 10) x))
        (+ x 1))
    (defun g (a)
      (declare (type (mod 10) a))
      (f (+ 12 a)))


; Warning: Result is a (INTEGER 12 21), not a (VALUES &OPTIONAL (MOD 10) &REST T).


Posted on the users mailing list.