(module compat mzscheme
(require (planet "version-case.ss" ("dyoo" "version-case.plt" 1 4)))
(require (prefix kw: (lib "kw.ss")))
(provide lambda/kw)
(version-case
((version< (version) "3.99")
(define-syntax lambda/kw
(make-rename-transformer #'kw:lambda/kw)))
(else
(require (only scheme make-keyword-procedure))
(define-syntax lambda/kw
(syntax-rules ()
[(lambda/kw formals . body)
(let ([inner-proc (kw:lambda/kw formals . body)])
(make-keyword-procedure
(lambda (kws kwargs . rest)
(apply inner-proc
(append (apply append (map list kws kwargs)) rest)))))])))))