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? I've certainly asked my fair share of noob- questions, and folks in this group have been quite happy to oblige me. I now find it easier to ask a question in this group about functions I've wanted, rather than implement (or poorly re-implement, as I did in my earlier days!) popular functions.
clojure.contrib isn't a part of clojure.core (otherwise it'd called clojure.core right?), but it I think it's very well-worth downloading and compiling. Parth's build instructions for clojure.contrib are good. However, clojure.contrib isn't required for 'accum'/'reduce' because 'reduce' is part of clojure.core. In fact, at the REPL you can enter: (doc reduce) and clojure.core will give you some information. (find-doc "reduce") turns up some extra stuff also. 'find-doc' is great! I admit that (find-doc "accum") didn't lead to 'reduce' which is mildly sad, but I'm sure I'll cope somehow. 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. If you don't feel comfortable with the offerings in clojure.contrib, that's fine also. Perhaps other folks can give testimonies about the usefulness/utility of clojure.contrib? I've found clojure.contrib really helpful and had no problems with it, even though there's no official release of it. Wishing you peace, Kev On Jun 17, 4:49 pm, Sean Devlin <[email protected]> wrote: > Wrexsoul, > Your right, I was out of line. I'm sorry. I should go through the > effort to explain myself rather than resort to personal attacks. > > Sean > > On Jun 17, 1:25 am, Wrexsoul <[email protected]> wrote: > > > > > On Jun 17, 12:57 am, Sean Devlin <[email protected]> wrote: > > > > Daniel, don't feed 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 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 in their entirety, rather than to search them! > > > > > Being able to read is one of the most basic, useful skills > > > > in programming. > > > This rudeness is uncalled-for. > > > > > Especially if you want to be pompous without being an ass. > > > Personal attacks are unwelcome here. > > > > > Oh? What about compared to this: > > > > > (use 'clojure.contrib.seq-utils) > > > > > (def *tris* (reductions + (iterate inc 1))) > > > Depends on a library that hasn't been released yet. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---
