From 33179e55e91c2584641436a59aa18c13aee09da7 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Fri, 15 Mar 2013 14:29:57 +0000 Subject: [PATCH] MORE COMMENT regarding the careful format of the encoded UCD data --- src/code/target-char.lisp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/code/target-char.lisp b/src/code/target-char.lisp index 121e05e..e798f07 100644 --- a/src/code/target-char.lisp +++ b/src/code/target-char.lisp @@ -203,6 +203,17 @@ ;;; 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) -- 1.7.10.4