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