Re: API in Clojure for Java folklore

2010-06-07 Thread Jason Smith
I think the right place for this is Maven, Ant, Leiningen, and command line. It's a generic thing for any build system. :-) Generating correct stubs is the common part, and then there is an integration into each system. I'm most interested in having this for Maven, but there's really not much t

Re: API in Clojure for Java folklore

2010-06-05 Thread ka
On Jun 5, 1:33 am, Jason Smith wrote: > The Java stubs are, ideally, a temporary thing.  They don't need to be > around forever.  However, I know of no way at present to generate them > automatically. > > Also, you are solving half the problem.  Generating the stubs and > class files at the same t

Re: API in Clojure for Java folklore

2010-06-04 Thread Jason Smith
The Java stubs are, ideally, a temporary thing. They don't need to be around forever. However, I know of no way at present to generate them automatically. Also, you are solving half the problem. Generating the stubs and class files at the same time does not solve the compile-time dependency pro

Re: API in Clojure for Java folklore

2010-06-04 Thread ka
@Jason I'm supplying a Java API (implemented in Clojure) so needed a solution quickly which just worked w/o me having to do special things. Hence the gen-class+javadoc macro (http://gist.github.com/415269). But I feel there should be something like this available in contrib which handles the whol

Re: API in Clojure for Java folklore

2010-06-01 Thread Jason Smith
[Note, you can implement this solution by writing stub classes by hand. This means you write stubbed out Java classes, run Javac first, and allow Clojure to overwrite the stubbed class files when it compiles. This is easy to do in Maven, and not difficult in ANT. And I have not actually tried th

Re: API in Clojure for Java folklore

2010-05-28 Thread ka
I've also added a :class-doc key to the macro - (gen-class+javadoc :class-doc "Class Docs One Two " :name "a.b.c.MyCoolClass" :methods [ #^{:static true} [method1 [clojure.lang.PersistentArrayMap] int] #^{:st

Re: API in Clojure for Java folklore

2010-05-26 Thread ka
Hi all, Inspired by Erik above, I've written a macro: gen-class+javadoc (http://gist.github.com/415269). It works quite well for me on Windows XP. For *nix, I think people will have to make at least one change - the shell command (at line 57). What it does - 1. Generates a javadoc for your API

Re: API in Clojure for Java folklore

2010-05-24 Thread Jason Smith
It sure seems like we need a good stub generator for Clojure. Java- interop just doesn't seem complete without it. On May 22, 10:12 pm, ka wrote: > Hi, any responses? > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, se

Re: API in Clojure for Java folklore

2010-05-24 Thread Erik Söhnel
hi, you could use a simple class signature generator and then run javadoc on it: (def javadoc-strings (atom {})) (defn javadoc [class name & body] (swap! javadoc-strings update-in [class] #(conj (or % []) %2) [name (apply str body)]) nil) (defn -myMethod "My cool documentation" [x y]

Re: API in Clojure for Java folklore

2010-05-22 Thread ka
Hi, any responses? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group,

API in Clojure for Java folklore

2010-05-21 Thread ka
Hi all, I've written an API in Clojure to be consumed by people working in the Java world. Now most of these people haven't even heard of Clojure; but all they care about is 1) a working API and 2) with nice documentation. 1) Something about the API - I tried out various things, types, records,