Re: generating a static method

2009-03-10 Thread Mark Volkmann
On Mon, Mar 9, 2009 at 9:52 PM, .Bill Smith wrote: > > Would someone mind showing me a brief example of how to define a > static method (using gen-class)? Look for "static" under http://www.ociweb.com/mark/clojure/article.html#Compiling. -- R. Mark Volkmann Object Computing, Inc. --~--~--

Re: generating a static method

2009-03-10 Thread .Bill Smith
That worked. Thank you for your help, Christophe. Bill Smith, Austin, TX --~--~-~--~~~---~--~~ 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 To unsubscribe

Re: generating a static method

2009-03-10 Thread Christophe Grand
Adrian Cuthbertson a écrit : > Hi Christophe, > > It works as per your example, but not with arguments to the method... > > ns gncls.MyStatic > (:gen-class > :methods [#^{:static true} [f [String] void ]])) > > (defn -f > [s] ; also [this s] doesn't work > (prn "Hi from " s )) > > (gncl

Re: generating a static method

2009-03-10 Thread Adrian Cuthbertson
Hi Christophe, It works as per your example, but not with arguments to the method... ns gncls.MyStatic (:gen-class :methods [#^{:static true} [f [String] void ]])) (defn -f [s] ; also [this s] doesn't work (prn "Hi from " s )) (gncls.MyStatic/f "me") java.lang.Exception: No such var

Re: generating a static method

2009-03-10 Thread Christophe Grand
.Bill Smith a écrit : > The genclass documentation says, "Static methods can be specified with > #^{:static true} in the signature's metadata." I thought that would > mean this: > > (ns tango.test.unit.StaticTest > (:gen-class > :methods [[f [] #^{:static true} void ]])) > > Try: (n

Re: generating a static method

2009-03-09 Thread Adrian Cuthbertson
HI Bill, I also tried the metadata tag and couldn't get it to work, but the following does... (ns gncls.MyStatic (:gen-class :methods [[say-hi [String] String]])) (defn -say-hi [this who] (str "Hi " who)) (defn -say-static-hi [who] (str "Hi " who)) user=> (compile 'gncls.MySta

Re: generating a static method

2009-03-09 Thread .Bill Smith
The genclass documentation says, "Static methods can be specified with #^{:static true} in the signature's metadata." I thought that would mean this: (ns tango.test.unit.StaticTest (:gen-class :methods [[f [] #^{:static true} void ]])) (defn -init [_] ()) (defn -f [] (println "hello w

generating a static method

2009-03-09 Thread .Bill Smith
Would someone mind showing me a brief example of how to define a static method (using gen-class)? Thanks, Bill Smith Austin, TX --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group