7.7
1 kw-lists-lambda
(require kw-utils/kw-lists-lambda) | package: kw-utils |
syntax
(kw-lists-lambda kws kw-args args body ...)
args = (arg ...) | (arg ... . rest-id) | rest-id arg = arg-id | [arg-id default-expr]
roughly equivalent to
(make-keyword-procedure (lambda (kws kw-args . args) body ...))
Examples:
> (require kw-utils/kw-lists-lambda)
> (define proc (kw-lists-lambda kws kw-args rest-args (list kws kw-args rest-args))) > (proc #:a 'a #:b 'b 0 1 2) '((#:a #:b) (a b) (0 1 2))
syntax
(kw-lists-case-lambda kws kw-args [args body ...] ...)
args = (arg-id ...) | (arg-id ... . rest-id) | rest-id
roughly equivalent to
(make-keyword-procedure (case-lambda [(kws kw-args . args) body ...] ...))
Examples:
> (require kw-utils/kw-lists-lambda)
> (define proc (kw-lists-case-lambda kws kw-args [(a) (list kws kw-args a)] [(a b) (list kws kw-args a b)])) > (proc #:a 'a #:b 'b 0) '((#:a #:b) (a b) 0)
> (proc #:a 'a #:b 'b 0 1) '((#:a #:b) (a b) 0 1)