SketchyLISP Reference |
Copyright (C) 2007 Nils M Holm |
<<[string-append] | [Index] | [string-ci<=?]>> |
Conformance: R5RS Scheme
Purpose: Case-insensitively test whether a sequence of strings is in lexically ascending order.
Arguments:
X - string
Y... - strings
Implementation:
(define string-ci<? (letrec ((ci-lt? (lambda (x y) (cond ((null? x) (not (null? y))) ((null? y) #f) ((char-ci<? (car x) (car y)) #t) ((char-ci>? (car x) (car y)) #f) (else (ci-lt? (cdr x) (cdr y))))))) (predicate-iterator (lambda (x y) (ci-lt? (string->list x) (string->list y))))))
Example:
(string-ci<? "abc" "XYZ" "zZz") => #t
See also:
string<?,
string-ci=?,
string-ci>?,
string-ci<=?,
string-ci>=?,
char-ci<?,
equal?.
<<[string-append] | [Index] | [string-ci<=?]>> |