HomeAboutCodePastes
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordieggsy <dieggsy@protonmail.com>2020-12-23 22:36:38 -0500
committerdieggsy <dieggsy@protonmail.com>2020-12-23 22:36:38 -0500
commit2476b4f814bbe15a8ae5a3b72ccea4fcc071c708 (patch)
tree146cf656c0cfba5ae2856eab9a5f26911207a511
parent2aad8064d4d6916baa101f717bfa771be3cb52b8 (diff)
downloadicu-2476b4f814bbe15a8ae5a3b72ccea4fcc071c708.tar.gz
Document with chalk0.3.2
-rw-r--r--LICENSE1
-rw-r--r--icu.egg4
-rw-r--r--icu.release-info9
-rw-r--r--icu.scm378
-rw-r--r--icu.svnwiki245
5 files changed, 247 insertions, 390 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..badfe6e
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1 @@
+[[https://github.com/unicode-org/icu/blob/master/icu4c/LICENSE|ICU License]]
diff --git a/icu.egg b/icu.egg
index 105bec7..ef91ca6 100644
--- a/icu.egg
+++ b/icu.egg
@@ -2,7 +2,7 @@
(synopsis "Chicken bindings to the ICU unicode library")
(category parsing)
(license "unicode")
- (dependencies utf8 srfi-13 srfi-1 foreigners)
+ (dependencies utf8 srfi-13 srfi-1 foreigners chalk)
(components
(extension icu
- (csc-options -O3 -L "`pkg-config --libs icu-uc`"))))
+ (csc-options -O3 -X chalk -L "`pkg-config --libs icu-uc`"))))
diff --git a/icu.release-info b/icu.release-info
index d7be224..0684690 100644
--- a/icu.release-info
+++ b/icu.release-info
@@ -1,6 +1,7 @@
;; -*- mode: scheme -*-
(uri targz "https://code.dieggsy.com/{egg-name}/snapshot/{egg-name}-{egg-release}.tar.gz")
-(release "0.3.1")
-(release "0.3.0")
-(release "0.2.0")
-(release "0.1.0")
+(release "0.3.2") ; Document with chalk
+(release "0.3.1") ; Fix issue with utf8 reexports
+(release "0.3.0") ; Slight API change
+(release "0.2.0") ; Make string-normalize form parameter optional
+(release "0.1.0") ; Initial version
diff --git a/icu.scm b/icu.scm
index 21cd3da..56debc2 100644
--- a/icu.scm
+++ b/icu.scm
@@ -109,12 +109,28 @@
(only srfi-1 take list-index)
srfi-4
(only foreigners define-foreign-enum-type))
+ @("Select bindings to the
+[[https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/index.html|ICU unicode library]].")
(reexport utf8)
(foreign-declare "#include <unicode/uchar.h>")
(foreign-declare "#include <unicode/unorm2.h>")
+ @(=== "Introduction")
+
+ @("This library is partially inspired by
+[[https://docs.python.org/3/library/unicodedata.html|Python's unicodedata library]].
+As it deals with unicode, it also reexports the utf8 egg for ease of use.")
+
+ @(=== "Procedures")
+
+ @(==== "Names")
(define (char-from-name name)
+ @("Return char corresponding to string name {{name}}. {{name}} is passed
+through {{string-upcase}}."
+ (@example
+ "(char-from-name \"fire\") ;; => #\\x1f525"
+ "(char-from-name \"FIRE\") ;; => #\\x1f525"))
(let ((char ((foreign-lambda* char (((const c-string) name))
"UErrorCode status = U_ZERO_ERROR;"
"UCharNameChoice choice = U_UNICODE_CHAR_NAME;"
@@ -128,6 +144,8 @@
(if (char=? #\null char) #f char)))
(define (char-string-name char)
+ @("Returns string name for {{char}}."
+ (@example "(char-string-name #\\x1f525) ;; => \"FIRE\""))
(let ((name ((foreign-lambda* c-string ((int32 code))
"char dbuffer[150];"
"UErrorCode status = U_ZERO_ERROR;"
@@ -146,15 +164,14 @@
(char->integer char))))
(if (string-null? name) #f name)))
- (define (char-digit-value char)
- (let ((decimal ((foreign-lambda* int32 ((int32 code))
- "C_return(u_charDigitValue(code));")
- (char->integer char))))
- (if (= decimal -1) #f decimal)))
-
;; (define digit decimal)
+ @(==== "Decomposition and Normalization")
(define (char-decomposition char)
+ @("Returns the decomposition mapping of {{char}}."
+ (@example
+ (@pre "For example, for ¼, VULGAR FRACTION ONE QUARTER:")
+ "(char-decomposition #\\xBC) ;; => '(#\\1 #\\x2044 #\\4)"))
(let* ((res (make-u16vector 16 0))
(len ((foreign-lambda* int32 ((int32 code) (u16vector dbuffer))
"UErrorCode status = U_ZERO_ERROR;"
@@ -168,7 +185,53 @@
(let ((lst (u16vector->list res)))
(map integer->char (take lst (list-index zero? lst)))))))
+ (define (string-normalize input #!optional (form "nfkc"))
+ @("Returns the normalized form of {{str}} to the destination string
+according to {{form}}"
+ (form "Any of {{\"nfc\"}}, {{\"nfkc\"}}, {{\"nfd\"}}, or {{\"nfkd\"}}")
+ (@example "(string-normalize \"¼\") ;; => \"1/4\""))
+ (when (not (member form '("nfkc" "nfc" "nfkd" "nfd")))
+ (error 'normalize "no such normalization form" form))
+ (let* ((input-len (string-length input))
+ (input (list->u16vector (map char->integer (string->list input))))
+ (mode (if (or (string=? form "nfc")
+ (string=? form "nfkc"))
+ (foreign-value UNORM2_COMPOSE int)
+ (foreign-value UNORM2_DECOMPOSE int)))
+ (form (cond ((string=? form "nfd") "nfc")
+ ((string=? form "nfkd") "nfkc")
+ (else form)))
+ (output-len ((foreign-lambda* int32 ((c-string form) (u16vector input) (int32 input_len) (int mode))
+ "UErrorCode status = U_ZERO_ERROR;"
+ "UNormalizer2 const *norm2 = unorm2_getInstance(NULL, form, mode, &status);"
+ "UChar dest[1];"
+ "int32_t output_len = unorm2_normalize(norm2, input, input_len, dest, 1, &status);"
+ "C_return(output_len);")
+ form input input-len mode))
+ (output (make-u16vector output-len 0)))
+ ((foreign-lambda* void ((c-string form) (u16vector input) (int32 input_len) (u16vector output) (int32 output_len) (int mode) )
+ "UErrorCode status = U_ZERO_ERROR;"
+ "UNormalizer2 const *norm2 = unorm2_getInstance(NULL, form, mode, &status);"
+ "int32_t len = unorm2_normalize(norm2, input, input_len, output, output_len, &status);")
+ form input input-len output output-len mode)
+ (list->string (map integer->char (u16vector->list output)))))
+
+
+ @(==== "Numbers")
+ (define (char-digit-value char)
+ @("Binding for {{u_charDigitValue}}. Returns the decimal digit value of a
+decimal digit character."
+ (@example "(char-digit-value #\\4) ;; => 4"))
+ (let ((decimal ((foreign-lambda* int32 ((int32 code))
+ "C_return(u_charDigitValue(code));")
+ (char->integer char))))
+ (if (= decimal -1) #f decimal)))
+
(define (char-numeric-value char)
+ @("Binding for {{u_getNumericValue}}. Get the numeric value (as a double) for a
+Unicode code point as defined in the Unicode Character Database."
+ (@example "(char-numeric-value #\\4) ;; => 4.0"
+ "(char-numeric-value #\\xBC) ;; => .25"))
(let ((decimal ((foreign-lambda* double ((int32 code))
"C_return(u_getNumericValue(code));")
(char->integer char))))
@@ -176,6 +239,84 @@
#f
decimal)))
+ (define (char-digit char radix)
+ @("Binding for {{u_digit}}. Returns the decimal digit value of the code point in
+the specified radix."
+ (@example "(char-digit #\\f 16) ;; => 15"))
+ ((foreign-lambda* int32 ((int32 code) (byte radix))
+ "C_return(u_digit(code, radix));")
+ (char->integer char)
+ radix))
+
+ (define char-for-digit
+ @(fn "Binding for {{u_isdigit}}. Determines whether the specified code point is a
+digit character according to Java."
+ (@sig (char-for-digit char radix))
+ (@example "(char-for-digit 15 16) ;; => #\\f"))
+ (foreign-lambda* char ((int32 digit) (byte radix))
+ "C_return(u_forDigit(digit, radix));"))
+
+ (define (char-digit? char)
+ @("Binding for {{u_isdigit}}. Determines whether the specified code point is a
+digit character according to Java.")
+ ((foreign-lambda* bool ((int32 code))
+ "C_return(u_isdigit(code));")
+ (char->integer char)))
+
+ (define (char-xdigit? char)
+ @("Binding for {{u_isxdigit}}. Determines whether the specified code point is a
+hexadecimal digit.")
+ ((foreign-lambda* bool ((int32 code))
+ "C_return(u_isxdigit(code));")
+ (char->integer char)))
+
+ @(==== "Operators and transformers")
+
+ (define (char-mirror char)
+ @("Binding for {{u_charMirror}}. Maps the specified character to a \"mirror-image\"
+character.")
+ ((foreign-lambda* char ((int32 code))
+ "C_return(u_charMirror(code));")
+ (char->integer char)))
+
+ (define (char-bidi-paired-bracket char)
+ @("Binding for {{u_getBidiPairedBracket}}. Maps the specified character to its
+paired bracket character.")
+ ((foreign-lambda* char ((int32 code))
+ "C_return(u_getBidiPairedBracket(code));")
+ (char->integer char)))
+
+ (define (char->lower char)
+ @("")
+ ((foreign-lambda* char ((int32 code))
+ "C_return(u_tolower(code));")
+ (char->integer char)))
+
+ (define (char->upper char)
+ @("")
+ ((foreign-lambda* char ((int32 code))
+ "C_return(u_toupper(code));")
+ (char->integer char)))
+
+ (define (char->title char)
+ @("")
+ ((foreign-lambda* char ((int32 code))
+ "C_return(u_totitle(code));")
+ (char->integer char)))
+
+ @("Bindings for {{u_tolower}},{{u_toupper}}, and {{u_totitle}}")
+
+ @(==== "Properties")
+
+ (define (char-category char)
+ @("Binding for {{u_charType}}. Returns the general category value for the code
+point (an integer, see below).
+
+You can convert this to a symbol with {{category->integer}}, and vice versa
+with {{integer->category}}")
+ ((foreign-lambda* int ((int32 code))
+ "C_return(u_charType(code));")
+ (char->integer char)))
(define-foreign-enum-type (category int)
(category->integer integer->category)
@@ -211,41 +352,49 @@
((category/final-punctuation U_FINAL_PUNCTUATION) U_FINAL_PUNCTUATION)
((category/char-category-count U_CHAR_CATEGORY_COUNT) U_CHAR_CATEGORY_COUNT))
- (define category/unassigned U_UNASSIGNED)
- (define category/uppercase-letter U_UPPERCASE_LETTER)
- (define category/lowercase-letter U_LOWERCASE_LETTER)
- (define category/titlecase-letter U_TITLECASE_LETTER)
- (define category/modifier-letter U_MODIFIER_LETTER)
- (define category/other-letter U_OTHER_LETTER)
- (define category/non-spacing-mark U_NON_SPACING_MARK)
- (define category/enclosing-mark U_ENCLOSING_MARK)
- (define category/combining-spacing-mark U_COMBINING_SPACING_MARK)
- (define category/decimal-digit-number U_DECIMAL_DIGIT_NUMBER)
- (define category/letter-number U_LETTER_NUMBER)
- (define category/other-number U_OTHER_NUMBER)
- (define category/space-separator U_SPACE_SEPARATOR)
- (define category/line-separator U_LINE_SEPARATOR)
- (define category/paragraph-separator U_PARAGRAPH_SEPARATOR)
- (define category/control-char U_CONTROL_CHAR)
- (define category/format-char U_FORMAT_CHAR)
- (define category/private-use-char U_PRIVATE_USE_CHAR)
- (define category/surrogate U_SURROGATE)
- (define category/dash-punctuation U_DASH_PUNCTUATION)
- (define category/start-punctuation U_START_PUNCTUATION)
- (define category/end-punctuation U_END_PUNCTUATION)
- (define category/connector-punctuation U_CONNECTOR_PUNCTUATION)
- (define category/other-punctuation U_OTHER_PUNCTUATION)
- (define category/math-symbol U_MATH_SYMBOL)
- (define category/currency-symbol U_CURRENCY_SYMBOL)
- (define category/modifier-symbol U_MODIFIER_SYMBOL)
- (define category/other-symbol U_OTHER_SYMBOL)
- (define category/initial-punctuation U_INITIAL_PUNCTUATION)
- (define category/final-punctuation U_FINAL_PUNCTUATION)
- (define category/char-category-count U_CHAR_CATEGORY_COUNT)
+ @("Categories:")
+ (define category/unassigned @("") U_UNASSIGNED)
+ (define category/uppercase-letter @("") U_UPPERCASE_LETTER)
+ (define category/lowercase-letter @("") U_LOWERCASE_LETTER)
+ (define category/titlecase-letter @("") U_TITLECASE_LETTER)
+ (define category/modifier-letter @("") U_MODIFIER_LETTER)
+ (define category/other-letter @("") U_OTHER_LETTER)
+ (define category/non-spacing-mark @("") U_NON_SPACING_MARK)
+ (define category/enclosing-mark @("") U_ENCLOSING_MARK)
+ (define category/combining-spacing-mark @("") U_COMBINING_SPACING_MARK)
+ (define category/decimal-digit-number @("") U_DECIMAL_DIGIT_NUMBER)
+ (define category/letter-number @("") U_LETTER_NUMBER)
+ (define category/other-number @("") U_OTHER_NUMBER)
+ (define category/space-separator @("") U_SPACE_SEPARATOR)
+ (define category/line-separator @("") U_LINE_SEPARATOR)
+ (define category/paragraph-separator @("") U_PARAGRAPH_SEPARATOR)
+ (define category/control-char @("") U_CONTROL_CHAR)
+ (define category/format-char @("") U_FORMAT_CHAR)
+ (define category/private-use-char @("") U_PRIVATE_USE_CHAR)
+ (define category/surrogate @("") U_SURROGATE)
+ (define category/dash-punctuation @("") U_DASH_PUNCTUATION)
+ (define category/start-punctuation @("") U_START_PUNCTUATION)
+ (define category/end-punctuation @("") U_END_PUNCTUATION)
+ (define category/connector-punctuation @("") U_CONNECTOR_PUNCTUATION)
+ (define category/other-punctuation @("") U_OTHER_PUNCTUATION)
+ (define category/math-symbol @("") U_MATH_SYMBOL)
+ (define category/currency-symbol @("") U_CURRENCY_SYMBOL)
+ (define category/modifier-symbol @("") U_MODIFIER_SYMBOL)
+ (define category/other-symbol @("") U_OTHER_SYMBOL)
+ (define category/initial-punctuation @("") U_INITIAL_PUNCTUATION)
+ (define category/final-punctuation @("") U_FINAL_PUNCTUATION)
+ (define category/char-category-count @("") U_CHAR_CATEGORY_COUNT)
+
+ @("----")
+ (define (char-direction char)
+ @("Binding for {{u_charDirection}}. Returns the bidirectional category value for
+the code point, which is used in the Unicode bidirectional algorithm (an
+integer, see below).
- (define (char-category char)
+You can convert this to a symbol with {{direction->integer}}, and vice versa
+with {{integer->direction}}.")
((foreign-lambda* int ((int32 code))
- "C_return(u_charType(code));")
+ "C_return(u_charDirection(code));")
(char->integer char)))
(define-foreign-enum-type (direction int)
@@ -275,215 +424,166 @@
((direction/pop-directional-isolate U_POP_DIRECTIONAL_ISOLATE) U_POP_DIRECTIONAL_ISOLATE)
((direction/char-direction-count U_CHAR_DIRECTION_COUNT) U_CHAR_DIRECTION_COUNT))
- (define direction/left-to-right U_LEFT_TO_RIGHT)
- (define direction/right-to-left U_RIGHT_TO_LEFT)
- (define direction/european-number U_EUROPEAN_NUMBER)
- (define direction/european-number-separator U_EUROPEAN_NUMBER_SEPARATOR)
- (define direction/european-number-terminator U_EUROPEAN_NUMBER_TERMINATOR)
- (define direction/arabic-number U_ARABIC_NUMBER)
- (define direction/common-number-separator U_COMMON_NUMBER_SEPARATOR)
- (define direction/block-separator U_BLOCK_SEPARATOR)
- (define direction/segment-separator U_SEGMENT_SEPARATOR)
- (define direction/white-space-neutral U_WHITE_SPACE_NEUTRAL)
- (define direction/other-neutral U_OTHER_NEUTRAL)
- (define direction/left-to-right-embedding U_LEFT_TO_RIGHT_EMBEDDING)
- (define direction/left-to-right-override U_LEFT_TO_RIGHT_OVERRIDE)
- (define direction/right-to-left-arabic U_RIGHT_TO_LEFT_ARABIC)
- (define direction/right-to-left-embedding U_RIGHT_TO_LEFT_EMBEDDING)
- (define direction/right-to-left-override U_RIGHT_TO_LEFT_OVERRIDE)
- (define direction/pop-directional-format U_POP_DIRECTIONAL_FORMAT)
- (define direction/dir-non-spacing-mark U_DIR_NON_SPACING_MARK)
- (define direction/boundary-neutral U_BOUNDARY_NEUTRAL)
- (define direction/first-strong-isolate U_FIRST_STRONG_ISOLATE)
- (define direction/left-to-right-isolate U_LEFT_TO_RIGHT_ISOLATE)
- (define direction/right-to-left-isolate U_RIGHT_TO_LEFT_ISOLATE)
- (define direction/pop-directional-isolate U_POP_DIRECTIONAL_ISOLATE)
- (define direction/char-direction-count U_CHAR_DIRECTION_COUNT)
-
- (define (char-direction char)
- ((foreign-lambda* int ((int32 code))
- "C_return(u_charDirection(code));")
- (char->integer char)))
+ @("Directions:")
+
+ (define direction/left-to-right @("") U_LEFT_TO_RIGHT)
+ (define direction/right-to-left @("") U_RIGHT_TO_LEFT)
+ (define direction/european-number @("") U_EUROPEAN_NUMBER)
+ (define direction/european-number-separator @("") U_EUROPEAN_NUMBER_SEPARATOR)
+ (define direction/european-number-terminator @("") U_EUROPEAN_NUMBER_TERMINATOR)
+ (define direction/arabic-number @("") U_ARABIC_NUMBER)
+ (define direction/common-number-separator @("") U_COMMON_NUMBER_SEPARATOR)
+ (define direction/block-separator @("") U_BLOCK_SEPARATOR)
+ (define direction/segment-separator @("") U_SEGMENT_SEPARATOR)
+ (define direction/white-space-neutral @("") U_WHITE_SPACE_NEUTRAL)
+ (define direction/other-neutral @("") U_OTHER_NEUTRAL)
+ (define direction/left-to-right-embedding @("") U_LEFT_TO_RIGHT_EMBEDDING)
+ (define direction/left-to-right-override @("") U_LEFT_TO_RIGHT_OVERRIDE)
+ (define direction/right-to-left-arabic @("") U_RIGHT_TO_LEFT_ARABIC)
+ (define direction/right-to-left-embedding @("") U_RIGHT_TO_LEFT_EMBEDDING)
+ (define direction/right-to-left-override @("") U_RIGHT_TO_LEFT_OVERRIDE)
+ (define direction/pop-directional-format @("") U_POP_DIRECTIONAL_FORMAT)
+ (define direction/dir-non-spacing-mark @("") U_DIR_NON_SPACING_MARK)
+ (define direction/boundary-neutral @("") U_BOUNDARY_NEUTRAL)
+ (define direction/first-strong-isolate @("") U_FIRST_STRONG_ISOLATE)
+ (define direction/left-to-right-isolate @("") U_LEFT_TO_RIGHT_ISOLATE)
+ (define direction/right-to-left-isolate @("") U_RIGHT_TO_LEFT_ISOLATE)
+ (define direction/pop-directional-isolate @("") U_POP_DIRECTIONAL_ISOLATE)
+ (define direction/char-direction-count @("") U_CHAR_DIRECTION_COUNT)
+
+ @("----")
(define (char-combining-class char)
+ @("Binding for {{u_getCombiningClass}}. Returns the combining class of the code
+point as specified in UnicodeData.txt.")
((foreign-lambda* unsigned-byte ((int32 code))
"C_return(u_getCombiningClass(code));")
(char->integer char)))
- (define (char-mirror char)
- ((foreign-lambda* char ((int32 code))
- "C_return(u_charMirror(code));")
- (char->integer char)))
-
- (define (char-bidi-paired-bracket char)
- ((foreign-lambda* char ((int32 code))
- "C_return(u_getBidiPairedBracket(code));")
- (char->integer char)))
-
- (define (char->lower char)
- ((foreign-lambda* char ((int32 code))
- "C_return(u_tolower(code));")
- (char->integer char)))
-
- (define (char->upper char)
- ((foreign-lambda* char ((int32 code))
- "C_return(u_toupper(code));")
- (char->integer char)))
-
- (define (char->title char)
- ((foreign-lambda* char ((int32 code))
- "C_return(u_totitle(code));")
- (char->integer char)))
-
;; (define (char-fold-case char)
;; ((foreign-lambda* char ((int32 code))
;; "C_return(u_foldCase(code));")
;; (char->integer char)))
- (define (char-digit char radix)
- ((foreign-lambda* int32 ((int32 code) (byte radix))
- "C_return(u_digit(code, radix));")
- (char->integer char)
- radix))
-
- (define char-for-digit
- (foreign-lambda* char ((int32 digit) (byte radix))
- "C_return(u_forDigit(digit, radix));"))
-
- (define (string-normalize input #!optional (form "nfkc"))
- (when (not (member form '("nfkc" "nfc" "nfkd" "nfd")))
- (error 'normalize "no such normalization form" form))
- (let* ((input-len (string-length input))
- (input (list->u16vector (map char->integer (string->list input))))
- (mode (if (or (string=? form "nfc")
- (string=? form "nfkc"))
- (foreign-value UNORM2_COMPOSE int)
- (foreign-value UNORM2_DECOMPOSE int)))
- (form (cond ((string=? form "nfd") "nfc")
- ((string=? form "nfkd") "nfkc")
- (else form)))
- (output-len ((foreign-lambda* int32 ((c-string form) (u16vector input) (int32 input_len) (int mode))
- "UErrorCode status = U_ZERO_ERROR;"
- "UNormalizer2 const *norm2 = unorm2_getInstance(NULL, form, mode, &status);"
- "UChar dest[1];"
- "int32_t output_len = unorm2_normalize(norm2, input, input_len, dest, 1, &status);"
- "C_return(output_len);")
- form input input-len mode))
- (output (make-u16vector output-len 0)))
- ((foreign-lambda* void ((c-string form) (u16vector input) (int32 input_len) (u16vector output) (int32 output_len) (int mode) )
- "UErrorCode status = U_ZERO_ERROR;"
- "UNormalizer2 const *norm2 = unorm2_getInstance(NULL, form, mode, &status);"
- "int32_t len = unorm2_normalize(norm2, input, input_len, output, output_len, &status);")
- form input input-len output output-len mode)
- (list->string (map integer->char (u16vector->list output)))))
+ @(==== "Predicates")
(define (char-mirrored? char)
+ @("")
((foreign-lambda* bool ((int32 code))
"C_return(u_isMirrored(code));")
(char->integer char)))
(define (char-ualphabetic? char)
+ @("")
((foreign-lambda* bool ((int32 code))
"C_return(u_isUAlphabetic(code));")
(char->integer char)))
(define (char-ulowercase? char)
+ @("")
((foreign-lambda* bool ((int32 code))
"C_return(u_isULowercase(code));")
(char->integer char)))
(define (char-uuppercase? char)
+ @("")
((foreign-lambda* bool ((int32 code))
"C_return(u_isUUppercase(code));")
(char->integer char)))
;; Whitespace
(define (char-uwhitespace? char)
+ @("")
((foreign-lambda* bool ((int32 code))
"C_return(u_isUWhiteSpace(code));")
(char->integer char)))
(define (char-whitespace? char)
+ @("")
((foreign-lambda* bool ((int32 code))
"C_return(u_isWhitespace(code));")
(char->integer char)))
(define (char-java-space? char)
+ @("")
((foreign-lambda* bool ((int32 code))
"C_return(u_isJavaSpaceChar(code));")
(char->integer char)))
(define (char-space? char)
+ @("")
((foreign-lambda* bool ((int32 code))
"C_return(u_isspace(code));")
(char->integer char)))
(define (char-blank? char)
+ @("")
((foreign-lambda* bool ((int32 code))
"C_return(u_isblank(code));")
(char->integer char)))
(define (char-lower? char)
+ @("")
((foreign-lambda* bool ((int32 code))
"C_return(u_islower(code));")
(char->integer char)))
(define (char-upper? char)
+ @("")
((foreign-lambda* bool ((int32 code))
"C_return(u_isupper(code));")
(char->integer char)))
- (define (char-digit? char)
- ((foreign-lambda* bool ((int32 code))
- "C_return(u_isdigit(code));")
- (char->integer char)))
-
(define (char-alpha? char)
+ @("")
((foreign-lambda* bool ((int32 code))
"C_return(u_isalpha(code));")
(char->integer char)))
(define (char-alnum? char)
+ @("")
((foreign-lambda* bool ((int32 code))
"C_return(u_isalnum(code));")
(char->integer char)))
- (define (char-xdigit? char)
- ((foreign-lambda* bool ((int32 code))
- "C_return(u_isxdigit(code));")
- (char->integer char)))
-
(define (char-punct? char)
+ @("")
((foreign-lambda* bool ((int32 code))
"C_return(u_ispunct(code));")
(char->integer char)))
(define (char-graph? char)
+ @("")
((foreign-lambda* bool ((int32 code))
"C_return(u_isgraph(code));")
(char->integer char)))
(define (char-defined? char)
+ @("")
((foreign-lambda* bool ((int32 code))
"C_return(u_isdefined(code));")
(char->integer char)))
(define (char-cntrl? char)
+ @("")
((foreign-lambda* bool ((int32 code))
"C_return(u_iscntrl(code));")
(char->integer char)))
(define (char-iso-control? char)
+ @("")
((foreign-lambda* bool ((int32 code))
"C_return(u_isISOControl(code));")
(char->integer char)))
(define (char-print? char)
+ @("")
((foreign-lambda* bool ((int32 code))
"C_return(u_isprint(code));")
(char->integer char)))
(define (char-base? char)
+ @("")
((foreign-lambda* bool ((int32 code))
"C_return(u_isbase(code));")
(char->integer char)))
diff --git a/icu.svnwiki b/icu.svnwiki
deleted file mode 100644
index 3694103..0000000
--- a/icu.svnwiki
+++ /dev/null
@@ -1,245 +0,0 @@
-[[tags: egg]]
-
-[[toc:]]
-
-== icu
-
-Select bindings to the
-[[https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/index.html|ICU unicode library]].
-
-=== Introduction
-
-This library is partially inspired by
-[[https://docs.python.org/3/library/unicodedata.html|Python's unicodedata
-library]]. As it deals with unicode, it also reexports the utf8 egg for ease of use.
-
-=== Procedures
-
-==== Names
-<procedure>(char-from-name name)</procedure>
-Return char corresponding to string name {{name}}. {{name}} is passed through
-{{string-upcase}}.
-
-<enscript highlight="scheme">
-(char-from-name "fire") ;; => #\x1f525
-(char-from-name "FIRE") ;; => #\x1f525
-</enscript>
-
-<procedure>(char-string-name char)</procedure>
-Returns string name for {{char}}.
-
-<enscript highlight="scheme">
-(char-string-name #\x1f525) ;; => "FIRE"
-</enscript>
-
-==== Decomposition and Normalization
-
-<procedure>(char-decomposition char)</procedure>
-
-Returns the decomposition mapping of {{char}}.
-
-For example, for ¼, VULGAR FRACTION ONE QUARTER:
-<enscript highlight="scheme">
-(char-decomposition #\xBC) ;; => '(#\1 #\x2044 #\4)
-</enscript>
-
-<procedure>(string-normalize str [form])</procedure>
-
-Returns the normalized form of {{str}} to the destination string according to
-{{form}}, which can be any of {{"nfc"}}, {{"nfkc"}}, {{"nfd"}}, or "{{nfkd}}"
-
-<enscript highlight="scheme">
-(string-normalize "¼") ;; => "1/4"
-</enscript>
-
-==== Numbers
-<procedure>(char-digit-value char)</procedure>
-Binding for {{u_charDigitValue}}. Returns the decimal digit value of a decimal
-digit character.
-
-<enscript highlight="scheme">
-(char-digit-value #\4) ;; => 4
-</enscript>
-
-<procedure>(char-numeric-value char)</procedure>
-Binding for {{u_getNumericValue}}. Get the numeric value (as a double) for a
-Unicode code point as defined in the Unicode Character Database.
-
-<enscript highlight="scheme">
-(char-numeric-value #\4) ;; => 4.0
-(char-numeric-value #\xBC) ;; => .25
-</enscript>
-
-<procedure>(char-digit char radix)</procedure>
-
-Binding for {{u_digit}}. Returns the decimal digit value of the code point in
-the specified radix.
-
-<enscript highlight="scheme">
-(char-digit #\f 16) ;; => 15
-</enscript>
-
-<procedure>(char-for-digit char radix)</procedure>
-
-Binding for {{u_forDigit}}. Determines the character representation for a
-specific digit in the specified radix.
-
-<enscript highlight="scheme">
-(char-for-digit 15 16) ;; => #\f
-</enscript>
-
-<procedure>(char-digit? char)</procedure>
-
-Binding for {{u_isdigit}}. Determines whether the specified code point is a
-digit character according to Java.
-
-<procedure>(char-xdigit? char)</procedure>
-
-Binding for {{u_isxdigit}}. Determines whether the specified code point is a
-hexadecimal digit.
-
-=== Operators and transformers
-
-<procedure>(char-mirror char)</procedure>
-
-Binding for {{u_charMirror}}. Maps the specified character to a "mirror-image"
-character.
-
-<procedure>(char-bidi-paired-pracket)</procedure>
-
-Binding for {{u_getBidiPairedBracket}}. Maps the specified character to its
-paired bracket character.
-
-<procedure>(char->lower char)</procedure>
-<procedure>(char->upper char)</procedure>
-<procedure>(char->title char)</procedure>
-
-Bindings for {{u_tolower}},{{u_toupper}}, and {{u_totitle}}
-
-=== Properties
-
-<procedure>(char-category char)</procedure>
-
-Binding for {{u_charType}}. Returns the general category value for the code
-point (an integer, see below).
-
-You can convert this to a symbol with {{category->integer}}, and vice versa
-with {{integer->category}}
-
-Categories:
-<enscript>
-category/unassigned
-category/uppercase-letter
-category/lowercase-letter
-category/titlecase-letter
-category/modifier-letter
-category/other-letter
-category/non-spacing-mark
-category/enclosing-mark
-category/combining-spacing-mark
-category/decimal-digit-number
-category/letter-number
-category/other-number
-category/space-separator
-category/line-separator
-category/paragraph-separator
-category/control-char
-category/format-char
-category/private-use-char
-category/surrogate
-category/dash-punctuation
-category/start-punctuation
-category/end-punctuation
-category/connector-punctuation
-category/other-punctuation
-category/math-symbol
-category/currency-symbol
-category/modifier-symbol
-category/other-symbol
-category/initial-punctuation
-category/final-punctuation
-category/char-category-count
-</enscript>
-
-<procedure>(char-direction char)</procedure>
-
-Binding for {{u_charDirection}}. Returns the bidirectional category value for
-the code point, which is used in the Unicode bidirectional algorithm (an
-integer, see below).
-
-You can convert this to a symbol with {{direction->integer}}, and vice versa
-with {{integer->direction}}
-
-Directions:
-<enscript>
-direction/left-to-right
-direction/right-to-left
-direction/european-number
-direction/european-number-separator
-direction/european-number-terminator
-direction/arabic-number
-direction/common-number-separator
-direction/block-separator
-direction/segment-separator
-direction/white-space-neutral
-direction/other-neutral
-direction/left-to-right-embedding
-direction/left-to-right-override
-direction/right-to-left-arabic
-direction/right-to-left-embedding
-direction/right-to-left-override
-direction/pop-directional-format
-direction/dir-non-spacing-mark
-direction/boundary-neutral
-direction/first-strong-isolate
-direction/left-to-right-isolate
-direction/right-to-left-isolate
-direction/pop-directional-isolate
-direction/char-direction-count
-</enscript>
-
-<procedure>(char-combining-class char)</procedure>
-
-Binding for {{u_getCombiningClass}}. Returns the combining class of the code
-point as specified in UnicodeData.txt.
-
-=== Predicates
-
-<enscript>
-char-mirrored?
-char-ualphabetic?
-char-ulowercase?
-char-uuppercase?
-char-uwhitespace?
-char-whitespace?
-char-java-space?
-char-space?
-char-blank?
-char-lower?
-char-upper?
-char-digit?
-char-alpha?
-char-alnum?
-char-xdigit?
-char-punct?
-char-graph?
-char-defined?
-char-cntrl?
-char-iso-control?
-char-print?
-char-base?
-</enscript>
-
-=== Author
-
-Diego A. Mundo
-
-=== License
-
-[[https://github.com/unicode-org/icu/blob/master/icu4c/LICENSE|ICU License]]
-
-=== Version History
-
-; 0.3.0 : Slight API change
-; 0.2.0 : Make string-normalize form parameter optional
-; 0.1.0 : Initial version