From 8a9bc0c4305c55a259f5d6db8ba2f0317b0821ae Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 7 Feb 2017 20:39:08 -0800 Subject: [PATCH] Implement char-general-category. --- src/runtime/char.scm | 4 ++++ src/runtime/runtime.pkg | 1 + 2 files changed, 5 insertions(+) diff --git a/src/runtime/char.scm b/src/runtime/char.scm index 79074aca9..860a65819 100644 --- a/src/runtime/char.scm +++ b/src/runtime/char.scm @@ -393,6 +393,10 @@ USA. (guarantee unicode-scalar-value? sv caller) (integer->char sv)) +(define (char-general-category char) + (guarantee unicode-char? char 'char-general-category) + (ucd-gc-value (char->integer char))) + (define-integrable (utf16-surrogate? cp) (fix:= #xD800 (fix:and #xF800 cp))) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index 3b3d38161..534d86517 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -1357,6 +1357,7 @@ USA. char-code char-code-limit char-downcase + char-general-category char-integer-limit char-upcase char-utf16-byte-length -- 2.25.1