Case-lambda
(case-lambda
{clause} ...
)
case-lambda library syntax
Syntax:
Each clause is of the form
(formals body),
where formals and body have the same syntax
as in a lambda expression.
Semantics:
A It is an error for the arguments not to agree with the formals of any clause.
(define range
(case-lambda
((e) (range 0 e))
((b e) (do ((r '() (cons e r))
(e (- e 1) (- e 1)))
((< e b) r)))))
(range 3) ==> (0 1 2)
(range 3 5) ==> (3 4)
|