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

max

Conformance: R5RS

Purpose: Find the maximum of a list of numbers.

Arguments:
A - number
B... - numbers

Implementation:

(define (max a . b)
  (letrec
    ((_max (lambda (a)
      (cond ((null? (cdr a)) (car a))
        ((> (car a) (cadr a))
          (_max (cons (car a) (cddr a))))
        (#t (_max (cdr a)))))))
    (cond ((null? b) a)
      (#t (_max (cons a b))))))

Example:

(max -25 5 25 0 -5) 
=> 25

See also:
digits, min, >.