SketchyLISP Reference |
Copyright (C) 2006 Nils M Holm |
<<[string-append] | [Index] | [string-ci<=?]>> |
Conformance: R5RS
Purpose: Case-insensitively test whether two strings are in lexically ascending order.
Arguments:
X - string
Y - string
Implementation:
(define (string-ci<? x y) (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) (#t (ci-lt? (cdr x) (cdr y))))))) (ci-lt? (string->list x) (string->list y))))
Example:
(string-ci<? "abc" "XYZ") => #t
See also:
string<?,
string-ci=?,
string-ci>?,
string-ci<=?,
string-ci>=?,
char-ci<?,
equal?.
<<[string-append] | [Index] | [string-ci<=?]>> |