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
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
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
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))
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
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
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: