| lambda <formals> <body> | STKLOS Syntax |
A lambda expression evaluates to a procedure. STklos lambda expression
have been extended to allow a optional and keyword parameters.
<formals> should have one of the following forms:
|
| closure? obj | STKLOS Procedure |
Returns #t if obj is a procedure created with the lambda syntax and
#f otherwise.
|
| case-lambda <clause> ... | STKLOS Syntax |
Each <clause> should have the form (<formals> <body>), where
<formals> is a formal arguments list as for lambda.
Each <body> is a <tail-body>, as defined in R5RS
.
A It is an error for the arguments not to agree with the This form is defined in SRFI-16 ("Syntax for procedures of variable arity") (define plus
(case-lambda
(() 0)
((x) x)
((x y) (+ x y))
((x y z) (+ (+ x y) z))
(args (apply + args))))
(plus) => 0
(plus 1) => 1
(plus 1 2 3) => 6
((case-lambda
((a) a)
((a b) (* a b)))
1 2 3) => error
|