From: Chris Hanson Date: Sun, 10 Feb 2019 22:04:07 +0000 (-0800) Subject: Eliminate potentially-problematic use of delay for char-set-predicate. X-Git-Tag: mit-scheme-pucked-10.1.10~6^2~8 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=deec31a7e14232a0fc9d30d9e9846c0d9ca5e6b0;p=mit-scheme.git Eliminate potentially-problematic use of delay for char-set-predicate. --- diff --git a/src/runtime/char-set.scm b/src/runtime/char-set.scm index bed378e3a..6ddc12f84 100644 --- a/src/runtime/char-set.scm +++ b/src/runtime/char-set.scm @@ -43,21 +43,18 @@ USA. char-set? (low %char-set-low) (high %char-set-high) - (predicate %char-set-predicate) + (predicate char-set-predicate) ;; backwards compatibility for Edwin: (table %char-set-table)) (define (make-char-set low high) - (letrec - ((char-set - (%make-char-set low high - (delay - (let ((predicate - (lambda (char) - (and (char? char) - (char-in-set? char char-set))))) - (register-predicate! predicate 'char-set-predicate '<= char?) - predicate)) + (letrec* + ((predicate + (lambda (char) + (and (char? char) + (char-in-set? char char-set)))) + (char-set + (%make-char-set low high predicate (delay (let ((table (make-bytevector #x100))) (do ((cp 0 (fix:+ cp 1))) @@ -67,6 +64,7 @@ USA. 1 0))) table))))) + (register-predicate! predicate 'char-set-predicate '<= char?) char-set)) (define-integrable %low-cps-per-byte 8) @@ -446,9 +444,6 @@ USA. (else #t))) #f))))) -(define (char-set-predicate char-set) - (force (%char-set-predicate char-set))) - (define (char-set-table char-set) (force (%char-set-table char-set)))