Re: Math as multimethods

2008-12-08 Thread ppierre
On 8 déc, 23:13, "Michael Reid" <[EMAIL PROTECTED]> wrote: > Then I of course write the implementations for various different > types. Then, because the multi-method names don't look nice, I wrote a > macro which transformed the regular operators into calls on the > multi-methods, i.e.: > >  (macr

Re: Math as multimethods

2008-12-08 Thread ppierre
On 8 déc, 17:14, Mark Fredrickson <[EMAIL PROTECTED]> wrote: > >> Alternatively, could I provide a "multi- > >> math" lib to redefine the core math functions? > > > Type classes would be king. > > Do you mean this in the Haskell sense? Yes : http://www.haskell.org/tutorial/classes.html Haskell ma

Re: Math as multimethods

2008-12-06 Thread ppierre
On 6 déc, 05:09, Mark Fredrickson <[EMAIL PROTECTED]> wrote: > Alternatively, could I provide a "multi- > math" lib to redefine the core math functions? Type classes would be king. But at least you can use your definition : (ns test.test (:refer-clojure :exclude [+ -])) (defn + [a b] 33

Re: Clojure template library

2008-12-04 Thread ppierre
A nice solution is PURE : http://beebole.com/pure/ JavaScript templating engine converting Json to HTML. With a Clojure version you have identical code for HTML and AJAX : Server side : Clojure/PURE + HTML -> HTML Client side : Clojure/JSON -> JavaScript/PURE + AJAX pierre --~--~-~--~

macro and ns

2008-11-30 Thread ppierre
http://paste.lisp.org/display/71272 I try to get *ns* of where macro is expended ; It works with : (defmacro m2 [p] `(f2 p ~'*ns*)) (defmacro m1 [p] `(f1 ~(m2 p))) ; But not with : (defmacro m1 [p] `(f1 (f2 p ~'*ns*))) I get ns user (REPL), from where I call a test function. I think

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

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 : #&q

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 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: French translation of the Clojure rationale

2008-11-21 Thread ppierre
C’est vrai que cela se lit mieux en anglais. Même si je peine à m’exprimer en anglais. Et la grammaire n’est pas mon fort. Mais si je peux, aidé à reformuler ? « Les plates-formes de développement, telles que Java, rassurent les clients, entreprises et institutions. Les standards offrent rapidit