t3x.org / sketchy / library / slep.html
SketchyLISP
Reference
  Copyright (C) 2007
Nils M Holm

string<=?

Conformance: R5RS Scheme

Purpose: Test whether a sequence of strings is in lexically non-descending order.

Arguments:
X - string
Y... - strings

Implementation:

(define string<=?
  (letrec
    ((le?
       (lambda (x y)
         (cond ((null? x) #t)
           ((null? y) #f)
           ((char<? (car x) (car y)) #t)
           ((char>? (car x) (car y)) #f)
           (else (le? (cdr x) (cdr y)))))))
  (predicate-iterator
    (lambda (x y)
      (le? (string->list x)
           (string->list y))))))

Example:

(string<=? "abc" "abc" "abx") 
=> #t

See also:
string-ci<=?, string<?, string=?, string>?, string>=?, char<=?, equal?.