MORE COMMENT regarding the careful format of the encoded UCD data
authorChristophe Rhodes <c.rhodes@gold.ac.uk>
Fri, 15 Mar 2013 14:29:57 +0000 (14:29 +0000)
committerChristophe Rhodes <csr21@cantab.net>
Sat, 18 May 2013 19:04:03 +0000 (20:04 +0100)
src/code/target-char.lisp

index 121e05e..e798f07 100644 (file)
 ;;; the character database once more to get to the relevant
 ;;; miscellaneous information.
 ;;;
+;;; As an optimization to the common case (pun intended) of looking up
+;;; case information for a character, the entries in C above are
+;;; sorted such that the characters which are UPPER-CASE-P in CL terms
+;;; have index values lower than all others, followed by those which
+;;; are LOWER-CASE-P in CL terms; this permits implementation of
+;;; character case tests without actually going to the trouble of
+;;; looking up the value associated with the index.  (Actually, this
+;;; isn't just a speed optimization; the information about whether a
+;;; character is BOTH-CASE-P is used just in the ordering and not
+;;; explicitly recorded in the database).
+;;;
 ;;; The moral of all this?  Next time, don't just say "FIXME: document
 ;;; this"
 (defun ucd-index (char)