#clojure logs

2008-05-07

08:04asbjxrnIf I want to call clojure from java, I guess I have to add clojure as a library and import some classes? Is clojure.jar enough?
08:08asbjxrnI'm thinking of using something along the lines described in the "java web start and clojure application" thread. (http://groups.google.com.sg/group/clojure/browse_thread/thread/f0c69735c5a9bd03/1e0dced366af9077?lnk=gst&q=webstart#1e0dced366af9077)
08:09asbjxrnSo I can use the interface designer in netbeans and just have the main function start the RT and hand over the control to clojure.
08:18cgrandasbjxrn: are you using a recent clojure form SVN or the last release?
08:19cgrandform -> from
08:19asbjxrnFrom SVN
08:21cgrandok, now it's even silmpler to embed Clojure. You only need clojure.jar and a file named user.clj (in the classpath).
08:21asbjxrnI'm trying to use enclojure. Not sure how to get the clojure.jar included. I've added it to the libraries of my project, but I get a package jvm.clojure.lang does not exist when I try to import jvm.clojure.lang.RT
08:22cgrandIn java code, just do something like RT.var("namespace", "name").invoke(....) and you are done.
08:23cgrandI don't have experience with enclojure but RT is clojure.lang.RT not jvm.clojure.lang.RT, "jvm" is the name of the root source folder
08:24asbjxrnAh. It should be import clojure.lang.RT, not import jvm.clojure.lang.RT...
08:24cgrandyes
08:30asbjxrnHmm. That user.clj trick is neat. But I guess I should then make my gui as a class instead of an swing application.
08:30asbjxrnTo avoid conflicts with main().
08:35cgranduser.clj won't get
08:36cgrand(oops I hit [enter])
08:38cgrandClojure won't get initialized (and thus user.clj executed) until you use it. I don't understand where you see a conflict with main().
08:45cgrand(I read what you wrote on #enclojure:) Yeah user.clj is here to help you automatically define and populate your namespaces, I don't think Rich intended it to be the main entry point to the program.
08:47asbjxrnI thought I saw something on the google group about user.clj being used as an entry point. Could be for the REPL/script class? Or more likely, I misunderstood.
09:05asbjxrnOk, got that part working... Now to do something useful...
09:05cgrand:-)
17:29nsinghalis there a function in clojure for doing modulo arithmetic?
17:29Chouserrem
17:34nsinghalthanks
18:34meredyddSo, what *is* the official entry point for a Clojure program?
18:35meredyddReferences are made to compilation, but is there a compiler that will give me a class with the traditional static main() method?
18:37meredyddThe method in scrollback seems to be about dynamic loading from a java class