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
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
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
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
--~--~-~--~
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
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:
> > >
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
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
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
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.
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
11 matches
Mail list logo