[r6rs-discuss] Compile-time detection of contract violations

From: AndrevanTonder <andre>
Date: Thu Oct 26 12:36:12 2006

On Thu, 26 Oct 2006, William D Clinger wrote:

> It is, I think. Section 9.22 of the R5.91RS draft says:
>
> Most implementations are able to recognize some violations
> when parsing, expanding macros, or compiling a definition
> or expression whose evaluation has not yet commenced in
> the usual sense. Implementations are allowed to use
> nonstandard exception handlers at those times, and are
> encouraged to raise &syntax exceptions for violations
> detected at those times,

Given this, it is unclear to me if the intent is that the expressions

   (with-exception-handler (lambda (condition) 1) (cons 1 2 3))

   (with-exception-handler (lambda (condition) 1) (/ 0))

   (with-exception-handler (lambda (condition) 1)
      (length (let ((ones (cons 1 #f)))
                (set-cdr! ones ones)))

should be portably valid Scheme. I.e., should the fact that there is a custom
runtime exception handler override any compile-time type checking, thus making
these expressions valid?

Andre
Received on Thu Oct 26 2006 - 12:32:51 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC