annotate src/clojureDemo/import_java_fns.clj @ 21:e72220627685
tip
0.002 inch discrepancy with target. going to test anyway
author |
Robert McIntyre <rlm@mit.edu> |
date |
Mon, 30 Aug 2010 01:19:21 -0400 |
parents |
6d9bdaf919f7 |
children |
|
rev |
line source |
rlm@1
|
1 (ns clojureDemo.import-java-fns)
|
rlm@1
|
2
|
rlm@1
|
3
|
rlm@1
|
4
|
rlm@1
|
5 (defmacro single-arg-fn [package fun]
|
rlm@1
|
6 (let [name (symbol (str package "/" fun))]
|
rlm@1
|
7 `(defn ~fun [a#] (~name a#))))
|
rlm@1
|
8
|
rlm@1
|
9 (defmacro java-map [package & fns]
|
rlm@1
|
10 `(do ~@(map #(list 'single-arg-fn package %) fns)))
|