Clojure DSL & JVM method length limits

2009-01-06 Thread Michiel de Mare
I'm converting a Ruby DSL into Clojure, and I'm running into some problems. I keep getting errors like this one: java.lang.ClassFormatError: Invalid method Code length 91069 in class file ... The DSL is a simple one - basically a long list of short forms. As each forms is evaluated, it adds its

Re: gen-class questions

2008-12-10 Thread Michiel de Mare
object itself (usually called "this"). > > In your example, what you want is: > (ns p.C (:gen-class :methods [[m [Object] void]])) > (defn -m [this o] (println (.. o getClass getName))) > > Hope that helps, > Chris > > On Wed, Dec 10, 2008 at 10:17 PM, Michiel de Mar

gen-class questions

2008-12-10 Thread Michiel de Mare
invoke' ... What's going on? Also, can somebody give an example of a gen-class call that specifies: - a static method - a method with an array among the parameters. Cheers, Michiel de Mare --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: eval in macro: No method for dispatch value

2008-12-03 Thread Michiel de Mare
Thank you very much for this detailed explanation! Michiel de Mare On Dec 3, 2:47 pm, Rich Hickey <[EMAIL PROTECTED]> wrote: > On Dec 3, 6:58 am, Michiel de Mare <[EMAIL PROTECTED]> wrote: > > > > > Indeed, (print-dup (new StringBuffer) (new java.io.StringWriter))

Re: eval in macro: No method for dispatch value

2008-12-03 Thread Michiel de Mare
23 pm, Meikel Brandmeyer <[EMAIL PROTECTED]> wrote: > Hi, > > On 3 Dez., 12:04, Michiel de Mare <[EMAIL PROTECTED]> wrote: > > > This has nothing to do with eval. The following fails too: > > > (defmacro foo [] (new StringBuffer)) > > (foo) > > The r

Re: eval in macro: No method for dispatch value

2008-12-03 Thread Michiel de Mare
This has nothing to do with eval. The following fails too: (defmacro foo [] (new StringBuffer)) (foo) On Dec 3, 3:22 am, Stuart Halloway <[EMAIL PROTECTED]> wrote: > Hi Michiel, > > eval is for form data, so I am more surprised that it works for   > ArrayList than that it fails for StringBuffer

eval in macro: No method for dispatch value

2008-12-02 Thread Michiel de Mare
After playing around with macros, I ran into this problem with Clojure (the latest version from github). The following code throws an IllegalArgumentException: "No method for dispatch value: class java.lang.StringBuffer" (defmacro wrap [h] (eval h)) (wrap (new StringBuffer)) But this works fine: