From: Christophe Rhodes Date: Sun, 14 Apr 2013 15:40:24 +0000 (+0100) Subject: comment on LSTRING implementation X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=9a74bfed915c39bac69e7ac979ba5a6fa7b7f1bd;p=sbcl.git comment on LSTRING implementation --- diff --git a/src/code/target-char.lisp b/src/code/target-char.lisp index 77ec7b2..1a932cd 100644 --- a/src/code/target-char.lisp +++ b/src/code/target-char.lisp @@ -709,7 +709,21 @@ character exists." (char= char2 #\combining_acute_accent)) #\latin_small_letter_e_with_acute)) -;;; generic sequences. *sigh*. +;;; This implements a sequence data structure, specialized for +;;; efficient deletion of characters at an index, along with tolerable +;;; random access. The purpose is to support the canonical +;;; composition algorithm from Unicode, which involves replacing (not +;;; necessarily consecutive) pairs of code points with a single code +;;; point (e.g. [#\e #\combining_acute_accent] with +;;; #\latin_small_letter_e_with_acute). The data structure is a list +;;; of three-element lists, each denoting a chunk of string data +;;; starting at the first index and ending at the second. +;;; +;;; Actually, the implementation isn't particularly efficient, and +;;; would probably benefit from being rewritten in terms of displaced +;;; arrays, which would substantially reduce copying. +;;; +;;; (also, generic sequences. *sigh*.) (defun lref (lstring index) (dolist (l lstring) (when (and (<= (first l) index)