I saw this post on Roman Numerals in Clojure:
This is the sort of little programming problem that can stop useful work dead in its tracks. Here’s my shot at the problem. I think it reads better in that the recursion just deals with the numbers and the Roman numeral strings are mapped latter. It’s also a bit more efficient in the way it tests against the Roman “bases” (as I call them). There’s no need to retest against a high base once your interim value has gone below that mark. In any case, my version is quite a bit faster than the other solution in my micro-benchmarks.
Paul Legato writes:
This quick overview will help to orient new Clojure programmers to the current state of the library system, with pointers to resources for further information.
We’re happy to announce today the release of Datomic Free Edition. This edition is oriented around making Datomic easier to get, and use, for open source and smaller production deployments.
Fold will try to do the computation in parallel using fork/join, when the input collection that is asked to apply the reducer to itself supports this and when the reducer supports this. The check for support is done through protocols: for the datastructures: PersistentVector extends CollFold, for the reducers: r/map is defined as a folder, while r/take-while is defined as a reducer (and does not support fold, because partitioning does not make sense for this computation). When parallel fold is not supported, then fold will just do a reduce. See the implementation for details: reducers.clj
A common approach for parallel processing is to use map+reduce. The work is divided into partitions and map is applied to each partition and the intermediate results are combined with reduce. In fold the approach is reduce+combine. The work on the smallest partition is done with a reduce rather than with map. Compare the two approaches by trying to express filter in map+reduce versus reduce+combine. It appeals to the functional programming sensibilities that reduce is a better fit for most operations than map.
Rich Hickey discusses the design decisions made for Datomic, a database for JVM languages: what problems they were trying to solve with it, the solutions chosen, and their implementations.
As of Clojure 1.3, the Clojure contrib libraries are organized in separate repositories. Unfortunately, a lot of links point to the old monolithic structure. Here’s the correct link for the current Clojure Contrib: