Implement char-general-category.
authorChris Hanson <org/chris-hanson/cph>
Wed, 8 Feb 2017 04:39:08 +0000 (20:39 -0800)
committerChris Hanson <org/chris-hanson/cph>
Wed, 8 Feb 2017 04:39:08 +0000 (20:39 -0800)
src/runtime/char.scm
src/runtime/runtime.pkg

index 79074aca9316cd61f6dee5dd96c0c11c0ad7add9..860a65819a57e7df0a80d5a83ff2a14760427a18 100644 (file)
@@ -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)))
 
index 3b3d381615b03f47f13cd35255191029eeb296e2..534d8651754f6935c49d60e1130b4e96423182e5 100644 (file)
@@ -1357,6 +1357,7 @@ USA.
          char-code
          char-code-limit
          char-downcase
+         char-general-category
          char-integer-limit
          char-upcase
          char-utf16-byte-length