Say hi to Mikael Boman's new blog The wheel of destiny!
First entry is about The top six technical practices every Product Owner must know about. Enjoy!
Kurser i Domain-Driven Design - Våren 2012
Tuesday, November 17, 2009
Tuesday, November 03, 2009
From Java to Clojure, followup followup
Martin Lübcke came up with this solution to the frequency sorting problem presented in the PNEHM article From Java to Clojure:
When it comes to performance, this version is about as fast as the original version in the article, but it sure is compact, and surprisingly readable. Many thanks to Martin!
Replace frest with fnext for Clojure 1.0.
(defn order-by-freq [coll]
(keys (sort-by #(vector (- (frest %)) (first %)) (frequencies coll))))
When it comes to performance, this version is about as fast as the original version in the article, but it sure is compact, and surprisingly readable. Many thanks to Martin!
Sunday, November 01, 2009
Subscribe to:
Posts (Atom)