Re: accum

2009-06-18 Thread jvt
t; As a friendly suggestion, I'd like to offer that perhaps the derision is > > caused not by the fact that you had the initiative to implement it > > yourself, but rather by such phrasing as: > > > > I'm shocked that [reduce/accum/foldr] is missing from clojure.core

Re: accum

2009-06-17 Thread Max Suica
Wrexsoul, please mate, these are good guys. Remember the beauty and tradition of the language you're learning. It's a lisp and gives you the power to effortlessly create almost any abstraction you can imagine. Not being convinced of the beauty of this, open you mind a bit and humble yourself some

Re: accum

2009-06-17 Thread Rich Hickey
such phrasing as: > > > > I'm shocked that [reduce/accum/foldr] is missing from clojure.core. > > > [...] This is one of the most basic, useful functions in functional > > > programming. > > > This seems to assert *as fact* that it is missing > >

Re: accum

2009-06-17 Thread Wrexsoul
On Jun 17, 4:00 pm, Rich Hickey wrote: > On Jun 17, 1:22 am, Wrexsoul wrote: > > The docs definitely have problems if this can be missed despite a very > > thorough search. The only more-thorough search would have been to > > actually read the docs in their entirety, rather than to search them!

Re: accum

2009-06-17 Thread Wrexsoul
On Jun 17, 3:52 pm, Daniel Lyons wrote: > On Jun 17, 2009, at 1:43 PM, Rich Hickey wrote: > > > Please refrain from communicating this way on this group. If a post > > annoys you please ignore it. It is much more important that we > > maintain civility and respectfulness here. > > My apologies to

Re: accum

2009-06-17 Thread Wrexsoul
On Jun 17, 2:47 pm, Kyle Schaffrick wrote: > As a friendly suggestion, I'd like to offer that perhaps the derision is > caused not by the fact that you had the initiative to implement it > yourself, but rather by such phrasing as: > > > I'm shocked that [reduce/

Re: accum

2009-06-17 Thread Wrexsoul
On Jun 17, 2:25 pm, Cosmin Stejerean wrote: > On Wed, Jun 17, 2009 at 12:51 PM, Wrexsoul wrote: > > > > Even though clojure.contrib hasn't been released as 1.0 or anything > > > official-sounding, I reckon it still beats the heck out of me > > > reinventing the wheel, especially with the calibre

Re: accum

2009-06-17 Thread Rich Hickey
On Jun 17, 1:22 am, Wrexsoul wrote: > On Jun 17, 12:44 am, Parth wrote: > > > > > > > On Jun 17, 9:34 am, Wrexsoul wrote: > > > I'm shocked that this is missing from clojure.core: > > > > (defn accum [f init coll] > > >   (

Re: accum

2009-06-17 Thread Daniel Lyons
On Jun 17, 2009, at 1:43 PM, Rich Hickey wrote: > Please refrain from communicating this way on this group. If a post > annoys you please ignore it. It is much more important that we > maintain civility and respectfulness here. My apologies to Wrexsoul. I was out of line. Civility and mutual

Re: accum

2009-06-17 Thread Rich Hickey
On Jun 17, 12:44 am, Daniel Lyons wrote: > On Jun 16, 2009, at 10:34 PM, Wrexsoul wrote: > > > > > > > > > I'm shocked that this is missing from clojure.core: > > > (defn accum [f init coll] > >  (loop [x init c coll] > >    (if (empt

Re: accum

2009-06-17 Thread Kyle Schaffrick
On Wed, 17 Jun 2009 10:51:48 -0700 (PDT), Wrexsoul wrote: > On Jun 17, 3:20 am, kkw wrote: >> I only knew about map, apply, and reduce from studying haskell in uni. >> I've not heard of 'reduce' referred to as 'accum', but then again when >> I wante

Re: accum

2009-06-17 Thread Cosmin Stejerean
On Wed, Jun 17, 2009 at 12:51 PM, Wrexsoul wrote: > > > Even though clojure.contrib hasn't been released as 1.0 or anything > > official-sounding, I reckon it still beats the heck out of me > > reinventing the wheel, especially with the calibre of folks who've > > contributed to clojure.contrib.

Re: accum

2009-06-17 Thread Wrexsoul
On Jun 17, 10:51 am, Mark Volkmann wrote: > On Wed, Jun 17, 2009 at 9:41 AM, CuppoJava wrote: > > Finding the right function in the doc admittedly takes a little > > practice. I've learned gradually, that Clojure pretty much has all its > > bases covered though. You just need to find the function

Re: accum

2009-06-17 Thread Wrexsoul
On Jun 17, 3:20 am, kkw wrote: > I only knew about map, apply, and reduce from studying haskell in uni. > I've not heard of 'reduce' referred to as 'accum', but then again when > I wanted to determine the number of elements in a seq, I kept > searching for &#

Re: accum

2009-06-17 Thread Wrexsoul
On Jun 17, 2:05 am, Parth wrote: > On Jun 17, 10:24 am, Wrexsoul wrote: > > > On Jun 17, 12:44 am, Daniel Lyons wrote: > > > > (use 'clojure.contrib.seq-utils) > > > Don't have that library. Still hasn't been released yet, last I > > checked. > > I am not sure if a pre-built clojure-contrib.jar

Re: accum

2009-06-17 Thread Wrexsoul
On Jun 17, 3:10 am, Mark Derricutt wrote: > There's prebuilt SNAPSHOT releases available in Howard's Tapestry repository > - been using them happily from my maven based clojure app for awhile. > Thou an official 1.0 stamped release in maven central (along with > clojure-lang) would be most welcom

Re: accum

2009-06-17 Thread Richard Newman
> Finding the right function in the doc admittedly takes a little > practice. I often end up reading through /api to find what I want, but "Clojure Categorized" might be a much faster way to do it: http://java.ociweb.com/mark/clojure/ClojureCategorized.html I don't know if it's kept up-to-dat

Re: accum

2009-06-17 Thread Mark Volkmann
On Wed, Jun 17, 2009 at 9:41 AM, CuppoJava wrote: > > Finding the right function in the doc admittedly takes a little > practice. I've learned gradually, that Clojure pretty much has all its > bases covered though. You just need to find the function. And this > forum is filled with very helpful an

Re: accum

2009-06-17 Thread CuppoJava
Finding the right function in the doc admittedly takes a little practice. I've learned gradually, that Clojure pretty much has all its bases covered though. You just need to find the function. And this forum is filled with very helpful and friendly people, who will tell you the function name, if y

Re: accum

2009-06-17 Thread kkw
I only knew about map, apply, and reduce from studying haskell in uni. I've not heard of 'reduce' referred to as 'accum', but then again when I wanted to determine the number of elements in a seq, I kept searching for 'length' and 'size' but didn

Re: accum

2009-06-17 Thread Mark Derricutt
There's prebuilt SNAPSHOT releases available in Howard's Tapestry repository - been using them happily from my maven based clojure app for awhile. Thou an official 1.0 stamped release in maven central (along with clojure-lang) would be most welcome. -- On Wed, Jun 17, 2009 at 6:05 PM, Parth wro

Re: accum

2009-06-16 Thread Sean Devlin
t; > Personal attacks are unwelcome here. > > > > Indeed! It's called reduce: > > > >http://clojure.org/api#toc476 > > > > I'm shocked you haven't noticed it in the API documentation. > > I SPECIFICALLY did a search of the entire api docs to s

Re: accum

2009-06-16 Thread Parth
On Jun 17, 10:24 am, Wrexsoul wrote: > On Jun 17, 12:44 am, Daniel Lyons wrote: > > > > (use 'clojure.contrib.seq-utils) > > Don't have that library. Still hasn't been released yet, last I > checked. I am not sure if a pre-built clojure-contrib.jar is available. You could consider building

Re: accum

2009-06-16 Thread Wrexsoul
I SPECIFICALLY did a search of the entire api docs to see if there was anything like "accum" already in there. I examined every occurrence of "seq" and turned up a blank. The docs definitely have problems if this can be missed despite a very thorough search. The only more

Re: accum

2009-06-16 Thread Wrexsoul
On Jun 17, 12:44 am, Daniel Lyons wrote: > Indeed! It's called reduce: > > http://clojure.org/api#toc476 > > I'm shocked you haven't noticed it in the API documentation. I SPECIFICALLY did a search of the entire api docs to see if there was anything like "

Re: accum

2009-06-16 Thread Wrexsoul
On Jun 17, 12:44 am, Parth wrote: > On Jun 17, 9:34 am, Wrexsoul wrote: > > I'm shocked that this is missing from clojure.core: > > > (defn accum [f init coll] > >   (loop [x init c coll] > >     (if (empty? c) > >       x > >       (recur (f x (fi

Re: accum

2009-06-16 Thread Sean Devlin
Daniel, don't feed the WrexTroll On Jun 17, 12:44 am, Daniel Lyons wrote: > On Jun 16, 2009, at 10:34 PM, Wrexsoul wrote: > > > > > > > > > I'm shocked that this is missing from clojure.core: > > > (defn accum [f init coll] > >

Re: accum

2009-06-16 Thread Daniel Lyons
On Jun 16, 2009, at 10:34 PM, Wrexsoul wrote: > > I'm shocked that this is missing from clojure.core: > > (defn accum [f init coll] > (loop [x init c coll] >(if (empty? c) > x > (recur (f x (first c)) (rest c) > > user=> (accum + 0 [1 2

Re: accum

2009-06-16 Thread Parth
On Jun 17, 9:34 am, Wrexsoul wrote: > I'm shocked that this is missing from clojure.core: > > (defn accum [f init coll] >   (loop [x init c coll] >     (if (empty? c) >       x >       (recur (f x (first c)) (rest c) > > user=> (accum + 0 [1 2 3]) > 6

accum

2009-06-16 Thread Wrexsoul
I'm shocked that this is missing from clojure.core: (defn accum [f init coll] (loop [x init c coll] (if (empty? c) x (recur (f x (first c)) (rest c) user=> (accum + 0 [1 2 3]) 6 user=> (accum + 0 [1 2 3 4 5]) 15 This is one of the most basic, useful f