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-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=d969b9bbceb5abfbfa1fa929a4a96dd4f7a81ffd;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 10398e25b..335fa98d5 100644 --- a/src/runtime/char-set.scm +++ b/src/runtime/char-set.scm @@ -43,22 +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 (bitless-char? char) - (char-in-set? char char-set))))) - (register-predicate! predicate 'char-set-predicate - '<= bitless-char?) - predicate)) + (letrec* + ((predicate + (lambda (char) + (and (bitless-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))) @@ -68,6 +64,7 @@ USA. 1 0))) table))))) + (register-predicate! predicate 'char-set-predicate '<= bitless-char?) char-set)) (define-integrable %low-cps-per-byte 8) @@ -448,9 +445,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)))