Mercurial > lasercutter
comparison src/clojureDemo/import_java_fns.clj @ 1:6d9bdaf919f7
added clojureDemo source
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Fri, 20 Aug 2010 00:32:44 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:163bf9b2fd13 | 1:6d9bdaf919f7 |
---|---|
1 (ns clojureDemo.import-java-fns) | |
2 | |
3 | |
4 | |
5 (defmacro single-arg-fn [package fun] | |
6 (let [name (symbol (str package "/" fun))] | |
7 `(defn ~fun [a#] (~name a#)))) | |
8 | |
9 (defmacro java-map [package & fns] | |
10 `(do ~@(map #(list 'single-arg-fn package %) fns))) |