SketchyLISP Reference |
Copyright (C) 2006 Nils M Holm |
<<[<] | [Index] | [=]>> |
Conformance: R5RS
Purpose:
Check whether two or more numbers are in non-ascending order.
Return
#t,
if
a<=b<=...
and otherwise
#f.
Arguments:
A - number
B... - numbers
Implementation:
(define (<= a . b) (letrec ((lteq (lambda (a b) (cond ((eq? a #t) #t) ((> a b) #t) (#t b))))) (cond ((null? b) (bottom '(too few arguments to <=))) (#t (neq? (reduce lteq (cons a b) #f) #t)))))
Example:
(<= 9 9 10) => #t
See also:
digits,
<,
>,
>=,
n<=.
<<[<] | [Index] | [=]>> |