Implement unicode-char-code?.
authorChris Hanson <org/chris-hanson/cph>
Sat, 11 Feb 2017 22:40:18 +0000 (14:40 -0800)
committerChris Hanson <org/chris-hanson/cph>
Sat, 11 Feb 2017 22:40:18 +0000 (14:40 -0800)
src/runtime/char.scm
src/runtime/predicate-metadata.scm
src/runtime/runtime.pkg

index 0f13d3d94566689455531165232a8814e7586311..21977494d4f216500681ff93ffc9b27981dafa87 100644 (file)
@@ -375,9 +375,11 @@ USA.
 
 (define (unicode-char? object)
   (and (char? object)
-       (let ((n (char->integer object)))
-        (and (unicode-scalar-value? n)
-             (not (non-character? n))))))
+       (unicode-char-code? (char->integer object))))
+
+(define (unicode-char-code? object)
+  (and (unicode-scalar-value? object)
+       (not (non-character? object))))
 
 (define-integrable (unicode-code-point? object)
   (and (index-fixnum? object)
index 06082e347bcc126da1eb4a86eb334ca8789ee912..89070c6979248a9fbcbc0ef6ccc444f47c556dc7 100644 (file)
@@ -316,6 +316,8 @@ USA.
                        '<= index-fixnum?)
    (register-predicate! unicode-scalar-value? 'unicode-scalar-value
                        '<= unicode-code-point?)
+   (register-predicate! unicode-char-code? 'unicode-char-code
+                       '<= unicode-scalar-value?)
    (register-predicate! uninterned-symbol? 'uninterned-symbol '<= symbol?)
    (register-predicate! weak-list? 'weak-list)
    (register-predicate! weak-pair? 'weak-pair)
index eb5d8af921d6c5e6018796e50a16cfe011ce1a04..939011029ad4e835de498a58c8cef0a7f24e24fd 100644 (file)
@@ -1395,6 +1395,7 @@ USA.
          radix?
          set-char-bits
          unicode-char->scalar-value
+         unicode-char-code?
          unicode-char?
          unicode-code-point-general-category
          unicode-code-point?