From: Taylor R Campbell Date: Sun, 10 Feb 2019 22:38:50 +0000 (+0000) Subject: Convert multi-LETREC to internal definitions in thread.scm. X-Git-Tag: mit-scheme-pucked-10.1.10~6^2~7^2~8 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=33d3e0390b074f6b49cd55ea1888faf3c9ebec68;p=mit-scheme.git Convert multi-LETREC to internal definitions in thread.scm. --- diff --git a/src/runtime/thread.scm b/src/runtime/thread.scm index a03d5639a..d030a2925 100644 --- a/src/runtime/thread.scm +++ b/src/runtime/thread.scm @@ -674,30 +674,28 @@ USA. (define (permanently-register-io-thread-event descriptor mode thread event) (let ((stop? #f) (registration #f)) - (letrec ((handler - (named-lambda (permanent-io-event mode*) - (if (not stop?) - (event mode*)) - (if (not (or stop? (memq mode* '(error hangup #f)))) - (register)))) - (register - (lambda () - (deregister) - (if (not stop?) - (set! registration - (register-io-thread-event descriptor mode - thread handler))))) - (deregister - (lambda () - (if registration - (begin - (deregister-io-thread-event registration) - (set! registration #f)))))) - (register) - (cons 'deregister-permanent-io-event - (lambda () - (set! stop? #t) - (deregister)))))) + (define handler + (named-lambda (permanent-io-event mode*) + (if (not stop?) + (event mode*)) + (if (not (or stop? (memq mode* '(error hangup #f)))) + (register)))) + (define (register) + (deregister) + (if (not stop?) + (set! registration + (register-io-thread-event descriptor mode + thread handler)))) + (define (deregister) + (if registration + (begin + (deregister-io-thread-event registration) + (set! registration #f)))) + (register) + (cons 'deregister-permanent-io-event + (lambda () + (set! stop? #t) + (deregister))))) (define (register-io-thread-event descriptor mode thread event) (guarantee-select-mode mode 'register-io-thread-event)