Re: clojure gen-class questions

2010-02-10 Thread Meikel Brandmeyer
Hi, Am 10.02.2010 um 21:05 schrieb Brian Wolf: > As a beginner, I tried running the first example,changing namespaces > or not, etc ,and I keep getting > > user=> (ns some.Example >(gen-class)) > nil > some.Example=> (defn -toString > [this] > "HI !") >

Re: clojure gen-class questions

2010-02-10 Thread Brian Wolf
Meikel, As a beginner, I tried running the first example,changing namespaces or not, etc ,and I keep getting user=> (ns some.Example (gen-class)) nil some.Example=> (defn -toString [this] "HI !") #'some.Example/-toString some.Example=> (ns user) nil

Re: clojure gen-class questions

2010-02-10 Thread Brian Wolf
yes,thank you, this looks very helpful On Feb 9, 3:44 pm, Meikel Brandmeyer wrote: > Hi, > > I wrote up a post:http://tr.im/NwCL > > Hope it helps. > > Sincerely > Meikel -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send em

Re: clojure gen-class questions

2010-02-10 Thread Аркадий Рост
thanks! -- 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

Re: clojure gen-class questions

2010-02-09 Thread Meikel Brandmeyer
Hi, Am 09.02.2010 um 18:10 schrieb Аркадий Рост: > Oh...So to make methods I must declare them in gen-class clause and if > some function wasn't include in gen-class clause, it wouldn't be a > method even if it had a prefix from gen-class clause. > I mean: > (ns example.class > (:gen-class > :

Re: clojure gen-class questions

2010-02-09 Thread Meikel Brandmeyer
Hi, I wrote up a post: http://tr.im/NwCL Hope it helps. Sincerely Meikel -- 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 patien

Re: clojure gen-class questions

2010-02-09 Thread Brian Wolf
Hi, I also am confused about gen-class, looking for a pointer to some code examples. Thanks, Brian ??? wrote: Oh...So to make methods I must declare them in gen-class clause and if some function wasn't include in gen-class clause, it wouldn't be a method even if it had a prefix fr

Re: clojure gen-class questions

2010-02-09 Thread Аркадий Рост
And one more, when and why "methods" should be used? (except main) -- 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 yo

Re: clojure gen-class questions

2010-02-09 Thread Аркадий Рост
Oh...So to make methods I must declare them in gen-class clause and if some function wasn't include in gen-class clause, it wouldn't be a method even if it had a prefix from gen-class clause. I mean: (ns example.class (:gen-class :prefix pre- :methods [[method_name1 [... arg types here ...]

Re: clojure gen-class questions

2010-02-09 Thread Аркадий Рост
Thaks for yor answer. It's really help me with studying. -- 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

Re: clojure gen-class questions

2010-02-09 Thread Meikel Brandmeyer
Hi, On Feb 9, 4:22 pm, Аркадий Рост wrote: > For example: > > (ns exaple_class >     (:gen-class)) > > (defn -main [args*] (...do smth...)) > (defn -method_name1 [args*] (...do smth...)) > (defn- -method_name2 [args*] (...do smth...)) > (def -a 5) > > (defn fun1 [args*] (...do smth...)) > (defn-

clojure gen-class questions

2010-02-09 Thread Аркадий Рост
Hi! For example: (ns exaple_class (:gen-class)) (defn -main [args*] (...do smth...)) (defn -method_name1 [args*] (...do smth...)) (defn- -method_name2 [args*] (...do smth...)) (def -a 5) (defn fun1 [args*] (...do smth...)) (defn- fun2 [args*] (...do smth...)) (def b 5) As I understand, in t

Re: gen-class questions

2008-12-10 Thread Michiel de Mare
Of course! Thanks a lot! On Dec 11, 7:23 am, "Chris Turner" <[EMAIL PROTECTED]> wrote: > Not sure about the other info you're looking for, but I think I can help > explain what's going on. All methods have an extra argument passed in > representing the object itself (usually called "this"). > > I

Re: gen-class questions

2008-12-10 Thread Chris Turner
Not sure about the other info you're looking for, but I think I can help explain what's going on. All methods have an extra argument passed in representing the object itself (usually called "this"). In your example, what you want is: (ns p.C (:gen-class :methods [[m [Object] void]])) (defn -m [thi

gen-class questions

2008-12-10 Thread Michiel de Mare
I'm trying to generate a Java class from Clojure with gen-class, but without much success. I've got the following code: (ns p.C (:gen-class :methods [[m [Object] void]])) (defn -m [o] (println (.. o getClass getName))) The signature of the m method is correct: javap p.C public class p.C extends