Re: Trying to rewrite a loop as map/reduce

2009-12-16 Thread DTH
On Dec 16, 8:13 am, Laurent PETIT wrote: > 2009/12/15 DTH > > > > (return-fn (some predicate-fn (iterate recur-fn a0))) > > > would seem equivalent, though I doubt I'd have got there without your > > stepwise guide to change the way I was thinking about it. &g

Re: Trying to rewrite a loop as map/reduce

2009-12-15 Thread DTH
If I might offer one small tweak: (return-fn (some predicate-fn (iterate recur-fn a0))) would seem equivalent, though I doubt I'd have got there without your stepwise guide to change the way I was thinking about it. Cheers, -DTH -- You received this message because you are subscribed to th

Re: Trying to rewrite a loop as map/reduce

2009-12-15 Thread DTH
nup the `reduce` in the above: (require '[clojure.contrib.seq-utils :as s-u]) (let [f1-4 [f1 f2 f3 f4]] (loop [a a0] (let [[a b c d e] (s-u/reductions #(%2 %1) a f1-4) g (f5 c) h (-> e f2 f5)] (if (or (f6? b) (<= g h)) e (recur (f7 d b

Re: what is the correct way to "mvn install" clojure-contrib

2009-12-14 Thread DTH
e -DpomFile=pom.xml -Dfile=clojure-contrib.jar seems to work for me with local builds; the same works for clojure itself. -DTH -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that

Re: what is the correct way to "mvn install" clojure-contrib

2009-12-14 Thread DTH
ntrib, and using the snapshots from build.clojure.org means there's less risk of others running in to build problems if they try to build your project from scratch. -DTH -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: Datatypes and protocols - update

2009-12-07 Thread DTH
On Dec 1, 9:56 pm, Rich Hickey wrote: > > There are 2 ways to make a deftype reach a protocol. First, you can > implement the protocol directly in the deftype/reify, supplying the > protocol where you do interfaces, and the methods of the protocol as > methods of the type. The type will be made to

Re: Functions and vars and meta-data

2009-11-27 Thread DTH
On Nov 27, 5:46 pm, Richard Newman wrote: > > I don't support the view that it's OK for programmers to not know what > they're doing, which in this case means knowing that 'foo reads as > (quote foo). FWIW I *strongly* agree; getting reader macros straight in my head was a *big* help in macro wri

Re: Michael newbee challange nr 1

2009-11-09 Thread DTH
On Nov 8, 12:33 pm, Michael Jaaka wrote: > > now I would like get such effect that callbackListener will be called twice > for the example collection. > > once with "tom" and iterator (or a lazy seq) to lazy evaluated collection of > (32 and 2333) > and second with "anne" and iterator for collect

Re: Clojure HTML Parser (Xpath) + HTTP client?

2009-08-23 Thread DTH
aries above directly to load the document and evaluate the xpath. -DTH On Aug 23, 2:02 am, dmix wrote: > I am planning on migrating an app from ruby to clojure (for > performance and to learn clojure) and before I proceed I wanted to > make sure a few libraries are available. > > One