How can operations like map, filter and reverse can be defined in terms of a reduce?
问题 In this blog entry, "CSP and transducers in JavaScript", the author states: First, we have to realise that many array (or other collection) operations like map , filter and reverse can be defined in terms of a reduce . My question is: How can operations like map, filter and reverse can be defined in terms of a reduce? Could you provide examples in Clojure? 回答1: This is true, if we don't care about laziness. In Clojure, map and filter are lazy, but reduce is eager. Not only is reverse not lazy