Next: Sorting, Previous: Tree Operations, Up: Sorting and Searching [Contents][Index]
The ‘chap:’ functions deal with strings which are ordered like chapter numbers (or letters) in a book. Each section of the string consists of consecutive numeric or consecutive aphabetic characters of like case.
Returns #t if the first non-matching run of alphabetic upper-case or
the first non-matching run of alphabetic lower-case or the first
non-matching run of numeric characters of string1 is
string<?
than the corresponding non-matching run of
characters of string2.
(chap:string<? "a.9" "a.10") ⇒ #t (chap:string<? "4c" "4aa") ⇒ #t (chap:string<? "Revised^{3.99}" "Revised^{4}") ⇒ #t
Implement the corresponding chapter-order predicates.
Returns the next string in the chapter order. If string
has no alphabetic or numeric characters,
(string-append string "0")
is returnd. The argument to
chap:next-string will always be chap:string<?
than the result.
(chap:next-string "a.9") ⇒ "a.10" (chap:next-string "4c") ⇒ "4d" (chap:next-string "4z") ⇒ "4aa" (chap:next-string "Revised^{4}") ⇒ "Revised^{5}"