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)) > > throws the same exception.

Re: eval in macro: No method for dispatch value

2008-12-03 Thread Rich Hickey
On Dec 3, 6:58 am, Michiel de Mare <[EMAIL PROTECTED]> wrote: > Indeed, (print-dup (new StringBuffer) (new java.io.StringWriter)) > throws the same exception. > But (new StringBuffer) in the REPL prints the stringbuffer just fine. > > Why does the exception only get triggered in macros? > > And do

Re: eval in macro: No method for dispatch value

2008-12-03 Thread Michiel de Mare
Indeed, (print-dup (new StringBuffer) (new java.io.StringWriter)) throws the same exception. But (new StringBuffer) in the REPL prints the stringbuffer just fine. Why does the exception only get triggered in macros? And doesn't print-dup need a default for unknown classes? On Dec 3, 12:23 pm, M

Re: eval in macro: No method for dispatch value

2008-12-03 Thread Meikel Brandmeyer
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 results at the Repl are printed via pr-on and obviously print-dup doesn't know how to print a StringBuffer. Sincerel

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

Re: eval in macro: No method for dispatch value

2008-12-02 Thread Stuart Halloway
Hi Michiel, eval is for form data, so I am more surprised that it works for ArrayList than that it fails for StringBuffer. Stu > After playing around with macros, I ran into this problem with Clojure > (the latest version from github). The following code throws an > IllegalArgumentException: