diff 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
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/clojureDemo/import_java_fns.clj	Fri Aug 20 00:32:44 2010 -0400
     1.3 @@ -0,0 +1,10 @@
     1.4 +(ns clojureDemo.import-java-fns)
     1.5 +
     1.6 +
     1.7 +
     1.8 +(defmacro single-arg-fn [package fun]
     1.9 +  (let [name (symbol (str package "/" fun))]
    1.10 +  `(defn ~fun [a#] (~name a#))))
    1.11 +
    1.12 +(defmacro java-map [package & fns]
    1.13 +  `(do ~@(map #(list 'single-arg-fn package %) fns)))