On Mon, Aug 10, 2009 at 10:31 PM, fft1976<fft1...@gmail.com> wrote: > > Is there a way to create a Java class (not instance) in Clojure > without writing actual Java? e.g. > > public class person { > public string name; > public int num_children; > public double weight; > }
Yes, tho perhaps not according to the example you have there. You can complie a clojure file by using gen-class: http://clojure.org/compilation gen-class does support a state declaration, but it doesn't seem to map cleanly to member variables as in your example. What is probably more idiomatic on the clojure side is to use a map for such a data object. I wrote up an example that uses gen-class and ant to create executable jars here: http://asymmetrical-view.com/2009/06/22/executable-clojure-jars.html Regards, Kyle Burton --~--~---------~--~----~------------~-------~--~----~ 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, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---