mixed parameters in formals
soo 19 May 2006 06:34 UTC
The following are examples in SRFI-89:
(define (h2 [key: k #f] a . r) (list a k r))
(h2 7) ==> (7 #f ())
(h2 7 8 9 10) ==> (7 #f (8 9 10))
(h2 key: 8 9 10) ==> (9 8 (10))
(h2 key: 8 zoo: 9) ==> error
1. If we make the required positional variable `a' to take a keyword
object as its value, is it possible?
2. I don't know what the `positional' of `required positional' means.
(h2 [key: k #f] a . r) --> the second parameter
(h2 7 8 9 10) --> the first actual argument
(h2 key: 8 9 10) --> the third actual argument
--
Joo ChurlSoo