Guest User

Untitled

a guest
May 28th, 2011
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1.         // Load the Clojure script -- as a side effect this initializes the runtime.    
  2.  
  3.         String str = "(ns user) (defn foo [a b]   (str a \" \" b))";    
  4.  
  5.         //RT.loadResourceScript("foo.clj");    
  6.  
  7.         clojure.lang.Compiler.load( new java.io.StringReader(str) );    
  8.  
  9.         // Get a reference to the foo function.  
  10.  
  11.         clojure.lang.Var foo = clojure.lang.RT.var("user", "foo");  
  12.  
  13.         // Call it!  
  14.  
  15.         Object Clojure_result = foo.invoke("Hi", "there");
Advertisement
Add Comment
Please, Sign In to add comment