Created
August 17, 2009 19:24
-
-
Save Plummtw/169318 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns user) | |
| (defn foo [i] | |
| (* 2 i)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns user) | |
| (defn foo [i] | |
| (* 4 i)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://code.google.com/p/clojure/downloads/list | |
| // javac TestClojureScript.java | |
| // java -cp .;clojure.jar TestClojureScript script1.clj # => 20 | |
| // java -cp .;clojure.jar TestClojureScript script2.clj # => 40 | |
| import clojure.lang.RT; | |
| import clojure.lang.Var; | |
| public class TestClojureScript { | |
| public static void main(String[] args){ | |
| try{ | |
| RT.loadResourceScript(args[0]); | |
| Var foo = RT.var("user", "foo"); | |
| Object result = foo.invoke(10); | |
| System.out.println(result); | |
| } | |
| catch (Exception e){ e.printStackTrace(); } | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment