Re: accum

2009-06-18 Thread jvt
: 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. [...] This is one of the most basic

Re: accum

2009-06-17 Thread Parth
On Jun 17, 10:24 am, Wrexsoul d2387...@bsnow.net wrote: On Jun 17, 12:44 am, Daniel Lyons fus...@storytotell.org 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

Re: accum

2009-06-17 Thread Sean Devlin
the WrexTroll 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 see if there was anything like accum already in there. I

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

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't think of 'count', so it can be a bit tricky eh

Re: accum

2009-06-17 Thread Mark Volkmann
On Wed, Jun 17, 2009 at 9:41 AM, CuppoJava patrickli_2...@hotmail.comwrote: 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

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

Re: accum

2009-06-17 Thread Wrexsoul
On Jun 17, 3:10 am, Mark Derricutt m...@talios.com 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

Re: accum

2009-06-17 Thread Wrexsoul
On Jun 17, 2:05 am, Parth parth.malwan...@gmail.com wrote: On Jun 17, 10:24 am, Wrexsoul d2387...@bsnow.net wrote: On Jun 17, 12:44 am, Daniel Lyons fus...@storytotell.org wrote: (use 'clojure.contrib.seq-utils) Don't have that library. Still hasn't been released yet, last I checked.

Re: accum

2009-06-17 Thread Wrexsoul
On Jun 17, 3:20 am, kkw kevin.k@gmail.com 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 'length' and 'size

Re: accum

2009-06-17 Thread Wrexsoul
On Jun 17, 10:51 am, Mark Volkmann r.mark.volkm...@gmail.com wrote: On Wed, Jun 17, 2009 at 9:41 AM, CuppoJava patrickli_2...@hotmail.comwrote: Finding the right function in the doc admittedly takes a little practice. I've learned gradually, that Clojure pretty much has all its bases

Re: accum

2009-06-17 Thread Cosmin Stejerean
On Wed, Jun 17, 2009 at 12:51 PM, Wrexsoul d2387...@bsnow.net 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

Re: accum

2009-06-17 Thread Kyle Schaffrick
On Wed, 17 Jun 2009 10:51:48 -0700 (PDT), Wrexsoul d2387...@bsnow.net wrote: On Jun 17, 3:20 am, kkw kevin.k@gmail.com 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

Re: accum

2009-06-17 Thread Rich Hickey
On Jun 17, 1:22 am, Wrexsoul d2387...@bsnow.net wrote: On Jun 17, 12:44 am, Parth parth.malwan...@gmail.com wrote: On Jun 17, 9:34 am, Wrexsoul d2387...@bsnow.net wrote: I'm shocked that this is missing from clojure.core: (defn accum [f init coll]   (loop [x init c coll

Re: accum

2009-06-17 Thread Wrexsoul
On Jun 17, 2:25 pm, Cosmin Stejerean cstejer...@gmail.com wrote: On Wed, Jun 17, 2009 at 12:51 PM, Wrexsoul d2387...@bsnow.net 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,

Re: accum

2009-06-17 Thread Wrexsoul
On Jun 17, 2:47 pm, Kyle Schaffrick k...@raidi.us 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/accum/foldr] is missing

Re: accum

2009-06-17 Thread Wrexsoul
On Jun 17, 3:52 pm, Daniel Lyons fus...@storytotell.org 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

Re: accum

2009-06-17 Thread Wrexsoul
On Jun 17, 4:00 pm, Rich Hickey richhic...@gmail.com wrote: On Jun 17, 1:22 am, Wrexsoul d2387...@bsnow.net 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

Re: accum

2009-06-17 Thread Rich Hickey
by 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 Well *something* was certainly missing, or I would have found it. You can't

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

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 functions in functional

Re: accum

2009-06-16 Thread Wrexsoul
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-thorough search would have been to actually read the docs