CONSTANT: name-map H{ }
: canonical-entry ( char -- seq ) canonical-map at ; inline
-: combine-chars ( a b -- char/f ) >2ch combine-map at ; inline
: compatibility-entry ( char -- seq ) compatibility-map at ; inline
+: combine-chars ( a b -- char/f ) >2ch combine-map at ; inline
: combining-class ( char -- n ) class-map at ; inline
: non-starter? ( char -- ? ) combining-class { 0 f } member? not ; inline
-: name>char ( name -- char ) name-map at ; inline
-: char>name ( char -- name ) name-map value-at ; inline
: property ( property -- interval-map ) properties at ; foldable
: property? ( char property -- ? ) property interval-sets:in? ; inline
-: ch>lower ( ch -- lower ) simple-lower ?at drop ; inline
-: ch>upper ( ch -- upper ) simple-upper ?at drop ; inline
-: ch>title ( ch -- title ) simple-title ?at drop ; inline
: special-case ( ch -- casing-tuple ) special-casing at ; inline
! For non-existent characters, use Cn
name-map sort-values keys
[ { [ "first>" tail? ] [ "last>" tail? ] } 1|| ] filter
2 group [
- [ name>char ] bi@ [ [a,b] ] [ table ?nth ] bi
+ [ name-map at ] bi@ [ [a,b] ] [ table ?nth ] bi
[ swap table ?set-nth ] curry each
] assoc-each table ;
} cleave
combine-map keys [ 2ch> nip ] map
-[ combining-class ] reject
+[ class-map at ] reject
[ 0 swap class-map set-at ] each
load-special-casing special-casing swap assoc-union! drop
load-properties properties swap assoc-union! drop
-[ name>char [ "Invalid character" throw ] unless* ]
-name>char-hook set-global
-
PRIVATE>
+
+[
+ name-map at [ "Invalid character" throw ] unless*
+] name>char-hook set-global