Re: Exception on the formatted print method calls

2008-11-30 Thread ppierre
On 30 nov, 02:42, Randall R Schulz <[EMAIL PROTECTED]> wrote: > On Saturday 29 November 2008 11:01, ppierre wrote: > > > On 29 nov, 17:13, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote: > > > On Nov 29, 2008, at 10:48 AM, ppierre wrote: > > > > But I can't compile core.clj when I put get-locale

Re: Exception on the formatted print method calls

2008-11-29 Thread Randall R Schulz
On Saturday 29 November 2008 11:01, ppierre wrote: > On 29 nov, 17:13, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote: > > On Nov 29, 2008, at 10:48 AM, ppierre wrote: > > > But I can't compile core.clj when I put get-locale and > > > with-locale   inside it. > > > > What error do you get? > > I h

Re: Exception on the formatted print method calls

2008-11-29 Thread ppierre
On 29 nov, 17:13, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote: > On Nov 29, 2008, at 10:48 AM, ppierre wrote: > > > But I can't compile core.clj when I put get-locale and with-locale   > > inside it. > > What error do you get? I have found it : #"(?:^|_)([a-zA-Z]*)" (re-pattern "(?:^|_)([a-zA-

Re: Exception on the formatted print method calls

2008-11-29 Thread Stephen C. Gilardi
On Nov 29, 2008, at 10:48 AM, ppierre wrote: > But I can't compile core.clj when I put get-locale and with-locale > inside it. What error do you get? >> - *locale* (should be set!-able as well), > A set-locale function ? No, I meant that if *locale* becomes part of Clojure at some p

Re: Exception on the formatted print method calls

2008-11-29 Thread ppierre
final static public Var LOCALE = Var.intern(CLOJURE_NS, Symbol.create ("*locale*"), null); (defn format "Formats a string using java.lang.String.format, see java.util.Formatter for format string syntax" [fmt & args] (let [locale (or *locale* (java.util.Locale/getDefault

Re: Exception on the formatted print method calls

2008-11-28 Thread Stephen C. Gilardi
On Nov 28, 2008, at 7:22 PM, ppierre wrote: > More complete : > > (def *locale* nil) > > (binding [clojure.core/format >(fn [fmt & args] > (String/format (or *locale* > (java.util.Locale/getDefault)) [...] > (with-out *err* > (with-locale "

Re: Exception on the formatted print method calls

2008-11-28 Thread ppierre
More complete : (def *locale* nil) (binding [clojure.core/format (fn [fmt & args] (String/format (or *locale* (java.util.Locale/getDefault)) fmt (to-array args))) *out* *err* *locale* java

Re: Exception on the formatted print method calls

2008-11-28 Thread ppierre
Why not add a *locale* var and use it in format ? You would write : (binding [*out* ... *locale* ... ] (printf ... )) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: Exception on the formatted print method calls

2008-11-28 Thread Kei Suzuki
On Nov 28, 1:05 am, "Michael Wood" <[EMAIL PROTECTED]> wrote: > On Fri, Nov 28, 2008 at 2:59 AM, Kei Suzuki <[EMAIL PROTECTED]> wrote: > > > On Nov 27, 11:21 am, Chouser <[EMAIL PROTECTED]> wrote: > [...] > >> All those methods take Java variadic arguments, which generally means > >> you need build

Re: Exception on the formatted print method calls

2008-11-28 Thread Michael Wood
On Fri, Nov 28, 2008 at 2:59 AM, Kei Suzuki <[EMAIL PROTECTED]> wrote: > > On Nov 27, 11:21 am, Chouser <[EMAIL PROTECTED]> wrote: [...] >> All those methods take Java variadic arguments, which generally means >> you need build the array the method is expecting. Fortunately, in the >> cases you l

Re: Exception on the formatted print method calls

2008-11-28 Thread Michael Wood
On Fri, Nov 28, 2008 at 3:05 AM, Kei Suzuki <[EMAIL PROTECTED]> wrote: > > On Nov 27, 12:07 pm, "Michael Wood" <[EMAIL PROTECTED]> wrote: >> On Thu, Nov 27, 2008 at 9:21 PM, Chouser <[EMAIL PROTECTED]> wrote: >> >> > On Thu, Nov 27, 2008 at 2:12 PM, Kei Suzuki <[EMAIL PROTECTED]> wrote: >> >> >> A

Re: Exception on the formatted print method calls

2008-11-27 Thread Kei Suzuki
On Nov 27, 12:07 pm, "Michael Wood" <[EMAIL PROTECTED]> wrote: > On Thu, Nov 27, 2008 at 9:21 PM, Chouser <[EMAIL PROTECTED]> wrote: > > > On Thu, Nov 27, 2008 at 2:12 PM, Kei Suzuki <[EMAIL PROTECTED]> wrote: > > >> Any formatted print method calls like below throw > >> java.lang.ClassCastExcepti

Re: Exception on the formatted print method calls

2008-11-27 Thread Kei Suzuki
On Nov 27, 11:21 am, Chouser <[EMAIL PROTECTED]> wrote: > On Thu, Nov 27, 2008 at 2:12 PM, Kei Suzuki <[EMAIL PROTECTED]> wrote: > > > Any formatted print method calls like below throw > > java.lang.ClassCastException at clojure.lang.Compiler.eval. > > > (.printf System/out "%d" 1) > > (. System/o

Re: Exception on the formatted print method calls

2008-11-27 Thread Michael Wood
On Thu, Nov 27, 2008 at 9:21 PM, Chouser <[EMAIL PROTECTED]> wrote: > > On Thu, Nov 27, 2008 at 2:12 PM, Kei Suzuki <[EMAIL PROTECTED]> wrote: >> >> Any formatted print method calls like below throw >> java.lang.ClassCastException at clojure.lang.Compiler.eval. >> >> (.printf System/out "%d" 1) >>

Re: Exception on the formatted print method calls

2008-11-27 Thread Chouser
On Thu, Nov 27, 2008 at 2:12 PM, Kei Suzuki <[EMAIL PROTECTED]> wrote: > > Any formatted print method calls like below throw > java.lang.ClassCastException at clojure.lang.Compiler.eval. > > (.printf System/out "%d" 1) > (. System/out (printf "%d" 1)) > (.format System/err java.util.Locale/US "%s"

Exception on the formatted print method calls

2008-11-27 Thread Kei Suzuki
Any formatted print method calls like below throw java.lang.ClassCastException at clojure.lang.Compiler.eval. (.printf System/out "%d" 1) (. System/out (printf "%d" 1)) (.format System/err java.util.Locale/US "%s" "error") (. System/out format nil "%s" "hello, world!\n") Am I missing something?