6.2.901.900
4 map with keyword arguments
like
rkt:map, but accepts keyword arguments as well as positional arguments.
Examples: |
> (require kw-utils/kw-map racket/math) | | > (map (λ (x) (+ x 1)) '(1 2 3 4)) | '(2 3 4 5) | > (map (λ (#:x x) (+ x 1)) #:x '(1 2 3 4)) | '(2 3 4 5) | > (map (λ (x y) (+ x y)) '(1 2 3 4) '(10 100 1000 10000)) | '(11 102 1003 10004) | > (map (λ (x #:y y) (+ x y)) '(1 2 3 4) #:y '(10 100 1000 10000)) | '(11 102 1003 10004) | | | > (map KE #:m '(2 2 2 2) #:v '(0 1 2 3)) | '(0 1 4 9) | > (map KE #:m '(0 1 2 3) #:v '(0 1 2 3)) | '(0 1/2 4 27/2) | > (map KE #:m '(1 2 1/2 2/9) #:v '(0 1 2 3)) | '(0 1 1 1) |
|