Thank you for your help. I have posted a message on the Enclojure
group yesterday and I am still waiting for it to show up...

On Jun 22, 5:46 am, "Stephen C. Gilardi" <[email protected]> wrote:
> On Jun 21, 2009, at 11:17 PM, arasoft wrote:
>
> > When I enter the following function into the REPL it compiles and
> > works without problems:
>
> > (defn harmonic-number [n prec]
> >    (reduce + (map #(with-precision prec (/ 1 (bigdec %))) (range 1 (inc
> > n))))
> > )
>
> > After (set! *warn-on-reflection* true), in a normal REPL I get:
>
> > Reflection warning, NO_SOURCE_PATH:3 - call to java.math.MathContext
> > ctor can't be resolved.
>
> You can give the compiler a type hint on prec to avoid the reflection:
>
>   (defn harmonic-number [n #^Integer prec]
>         (reduce + (map #(with-precision prec (/ 1 (bigdec %))) (range 1 (inc
> n))))
> )
>
> > In Enclojure, it's worse:
> > <CompilerException java.lang.ClassCastException:
> > java.io.OutputStreamWriter cannot be cast to java.io.PrintWriter
> > (NO_SOURCE_FILE:8)>
>
> (At least) some versions of Enclojure are binding *err* to an  
> OutputStreamWriter rather than a PrintWriter. Clojure's default  
> binding is to a PrintWriter and some of Clojure expects a PrintWriter.
>
> I consider binding *err* to an OutputStreamWriter to be a bug. I think  
> the Enclojure developers know about it, so if there's a version of  
> Enclojure you haven't upgraded to, I recommend trying that.
>
> If you're using the latest version, I suggest taking a look at their  
> bug list (if it's public) and/or letting them know about it.
>
> --Steve
>
>  smime.p7s
> 3KViewDownload
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to