Changes for clojure.core/reduce

uvtc on Tue, 31 Jul 2012
;; Create a word frequency map out of a large string s.

;; `s` is a long string containing a lot of words :)
(reduce #(assoc %1 %2 (inc (%1 %2 0)))
        {}
        (re-seq #"\w+" s))

; (This can also be done using the `frequencies` function.)
uvtc on Tue, 31 Jul 2012
;; Create a word frequency map out of a large string s

;; `s` is a long string containing a lot of words :)
(reduce #(assoc %1 %2 (inc (%1 %2 0)))
        {}
        (re-seq #"\w+" s))

; (This can also be done using the `frequencies` function.)
boxie on Mon, 15 Nov 2010
;; Create a word frequency map out of a large string s

;; s is set to a large string with a lot of words
(reduce #(assoc %1 %2 (inc (%1 %2 0))) {} (re-seq #"\w+" s))

;this can also be done using the (frequencies) function
zkim on Sun, 26 Sep 2010
;; Create a word frequency map out of a large string s

;; s is set to a large string with a lot of words
(reduce #(assoc %1 %2 (inc (%1 %2 0))) {} (re-seq #"\w+" s))
ghoseb on Tue, 13 Jul 2010
Create a word frequency map out of a large string s


;;; s is set to a large string with a lot of words
(reduce #(assoc %1 %2 (inc (%1 %2 0))) {} (re-seq #"\w+" s))