[r6rs-discuss] Compile-time detection of contract violations
On Tue, 24 Oct 2006, Jason Orendorff wrote:
> What about at compile time? Does R5.91RS allow an implementation to
> detect a contract violation at compile time and reject the program? I
> couldn't find any such wording. I think this should be allowed.
>
> Opinions will differ on whether this behavior is helpful, and no
> compiler can detect all contract violations at compile time. Still,
> any optimizing compiler will be able to detect some of these, and
> treating them as errors seems reasonable to me.
It is definitely useful. Having an error instead of just a warning,
though, would change the semantics of Scheme, as the expression
(if #t 1 (cons 2 3 4)) ==> 1
illustrates. I am not advocating either way.
Andre
Received on Tue Oct 24 2006 - 10:47:13 UTC
This archive was generated by hypermail 2.3.0
: Wed Oct 23 2024 - 09:15:01 UTC