apply recursive decomposition in DECOMPOSE-STRING
authorChristophe Rhodes <csr21@cantab.net>
Thu, 18 Apr 2013 17:03:09 +0000 (18:03 +0100)
committerChristophe Rhodes <csr21@cantab.net>
Sat, 18 May 2013 19:04:04 +0000 (20:04 +0100)
We should really precompute the result of the recursion during the build;
working on getting tests up and running so that we can check whether
we've done that correctly.

src/code/target-char.lisp

index ef51c23..0e12980 100644 (file)
@@ -685,7 +685,14 @@ character exists."
            ((null end) (push (subseq string start end) result))
         (unless (= start end)
           (push (subseq string start end) result))
-        (push (decompose-char (char string end)) result))
+        ;; FIXME: this recursive call to DECOMPOSE-STRING is necessary
+        ;; for correctness given our direct encoding of the
+        ;; decomposition data in UnicodeData.txt.  It would, however,
+        ;; be straightforward enough to perform the recursion in table
+        ;; construction, and then have this simply revert to a single
+        ;; lookup.  (Wait for tests to be hooked in, then implement).
+        (push (decompose-string (decompose-char (char string end)) kind)
+              result))
       (apply 'concatenate 'string (nreverse result)))))
 
 (defun sort-combiners (string)