Clojure Reduce and SICP Accumulate

18 views
Skip to first unread message

janu

unread,
Aug 21, 2011, 1:11:34 AM8/21/11
to p2pu...@googlegroups.com
Hello All,

  I just noticed this subtle difference ... I will check out Clojure source later.

 (accumulate cons nil (list 1 2 3 4 5)) this works for SICP example
(reduce cons nil (list 1 2 3 4 5)) fails ...
However, (reduce cons (list 1 2 3 4 5) nil) .. gives the same result as accumulate.

Emeka
Reply all
Reply to author
Forward
0 new messages