diff --git a/src/ikarus.boot b/src/ikarus.boot index 9e1668c..72e3bb8 100644 Binary files a/src/ikarus.boot and b/src/ikarus.boot differ diff --git a/src/ikarus.handlers.ss b/src/ikarus.handlers.ss index 4a587b7..f644048 100644 --- a/src/ikarus.handlers.ss +++ b/src/ikarus.handlers.ss @@ -17,6 +17,26 @@ [(v) (set! x (guard v))])]))) +(library (ikarus system handlers) + (export interrupt-handler + $apply-nonprocedure-error-handler) + (import (except (ikarus) interrupt-handler)) + + (define interrupt-handler + (make-parameter + (lambda () + (flush-output-port (console-output-port)) + (error #f "interrupted")) + (lambda (x) + (if (procedure? x) + x + (error 'interrupt-handler "~s is not a procedure" x))))) + + (define $apply-nonprocedure-error-handler + (lambda (x) + (error 'apply "~s is not a procedure" x))) + ) + (library (ikarus handlers) (export) @@ -28,19 +48,7 @@ (lambda args (foreign-call "ik_error" args))) -(primitive-set! 'interrupt-handler - (make-parameter - (lambda () - (flush-output-port (console-output-port)) - (error #f "interrupted")) - (lambda (x) - (if (procedure? x) - x - (error 'interrupt-handler "~s is not a procedure" x))))) -(primitive-set! '$apply-nonprocedure-error-handler - (lambda (x) - (error 'apply "~s is not a procedure" x))) (primitive-set! '$incorrect-args-error-handler (lambda (p n) diff --git a/src/makefile.ss b/src/makefile.ss index a972142..c4d9098 100755 --- a/src/makefile.ss +++ b/src/makefile.ss @@ -502,6 +502,7 @@ [library-spec s i] [current-library-collection s i] [invoke-library s i] + [$apply-nonprocedure-error-handler s] ))