Permalink
Browse files

return clj to java

  • Loading branch information...
Jay Fields
Jay Fields committed Dec 24, 2011
1 parent 783eb6f commit 67131ff1a34c4278db73e80b3ca5b17554422e76
Showing with 2 additions and 16 deletions.
  1. +1 −15 src/clojure/interop/core.clj
  2. +1 −1 src/java/interop/Example.java
@@ -1,18 +1,4 @@
(ns interop.core)
(defn proxy-coll []
(proxy [java.util.Collection] []
(add [o]
(println o)
true)))
(defn reify-coll []
(reify java.util.Collection
(add [this o]
(println o)
(println this)
true)))
(defn main []
(.add (proxy-coll) "this string is printed on proxied.add")
(.add (reify-coll) "this string is printed on reified.add"))
{:a 1 :b 2})
@@ -5,6 +5,6 @@
public class Example {
public static void main(String[] args) throws Exception {
RT.loadResourceScript("interop/core.clj");
RT.var("interop.core", "main").invoke();
System.out.println(RT.var("interop.core", "main").invoke());
}
}

0 comments on commit 67131ff

Please sign in to comment.