From bbd181214a8d34d4daecf7f96ef465e61df2eff0 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 13 Jan 2018 13:07:38 -0800 Subject: [PATCH] Fix bug: two copies of unicode-char? were causing confusion. --- doc/ref-manual/characters.texi | 10 +++------- src/runtime/char.scm | 6 ------ src/runtime/chrset.scm | 3 ++- src/runtime/runtime.pkg | 3 +-- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/doc/ref-manual/characters.texi b/doc/ref-manual/characters.texi index 63783ba3c..17938c6ff 100644 --- a/doc/ref-manual/characters.texi +++ b/doc/ref-manual/characters.texi @@ -438,13 +438,9 @@ it returns @code{#f}. @end deffn @deffn procedure unicode-char? object -Returns @code{#t} if @var{object} is a character corresponding to a -Unicode scalar value, otherwise it returns @code{#f}. In other words, -it is true for any character for which @code{char->integer} returns a -value satisfying @code{unicode-scalar-value?}. - -Note that this is a bit of a misnomer since characters corresponding -to Unicode ``noncharacter'' scalar values satisfy this predicate. +Returns @code{#t} if @var{object} is any ``bitless'' character +corresponding to a Unicode code point, except for those with general +category @code{other:surrogate} or @code{other:not-assigned}. @end deffn @deffn procedure char-general-category char diff --git a/src/runtime/char.scm b/src/runtime/char.scm index 3d52e11ac..333cef286 100644 --- a/src/runtime/char.scm +++ b/src/runtime/char.scm @@ -364,12 +364,6 @@ USA. ;;;; Unicode characters -(define (unicode-char? object) - (and (char? object) - (let ((cp (char->integer object))) - (and (fix:< cp char-code-limit) - (not (utf16-surrogate? cp)))))) - (define (unicode-scalar-value? object) (and (unicode-code-point? object) (not (utf16-surrogate? object)))) diff --git a/src/runtime/chrset.scm b/src/runtime/chrset.scm index eb4934e64..efc7827b3 100644 --- a/src/runtime/chrset.scm +++ b/src/runtime/chrset.scm @@ -54,7 +54,8 @@ USA. (lambda (char) (and (bitless-char? char) (char-in-set? char char-set))))) - (register-predicate! predicate 'char-set-predicate '<= char?) + (register-predicate! predicate 'char-set-predicate + '<= bitless-char?) predicate))))) char-set)) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index dcfc4bc73..2111df025 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -1226,8 +1226,7 @@ USA. (files "char") (parent (runtime)) (export () deprecated:character - (code->char integer->char) - (wide-char? unicode-char?)) + (code->char integer->char)) (export () 8-bit-char? ascii-char? -- 2.25.1