Consider the following example:
(->> [1 2 3 4] (map #(* % 2)) (reduce +))Result:
20
I decided to learn a functional language: I chose Clojure, because it runs on the JVM, and it seems more easy to digest for me, having some Java background. In this blog, I am going to write notes mainly for myself. However, since I already take the time to write them down, why not publish them? Maybe they will be useful for someone else too :) Please keep in mind, that I'm an absolute beginner in Clojure. So please use my blog only at your own responsibility. You have been warned ;)
(->> [1 2 3 4] (map #(* % 2)) (reduce +))Result:
20
No comments:
Post a Comment