Learning Clojure: comparing with Java streams
blog.frankel.ch
Learning Clojure: comparing with Java streams
1–10 of 46 posts
Re: Learning Clojure: comparing with Java streams
#2Re: Learning Clojure: comparing with Java streams
#3It seems strange to me that `(map extract-name justice-league)` isn't listed under "idiomatic improvements." Supposing you already had `extract-name` defined for some reason, it's cleaner and simpler to just map that unary function than wrap that function in an anonymous function - whether that wrapping is done with the `#(...)` reader syntax or explicitly constructed with `fn`.
Re: Learning Clojure: comparing with Java streams
#4Erm, what? I am confused by the use of the word 'limited' in this context.
Re: Learning Clojure: comparing with Java streams
#5It seems strange to me that `(map extract-name justice-league)` isn't listed under "idiomatic improvements." Supposing you already had `extract-name` defined for some reason, it's cleaner and simpler to just map that unary function than wrap that function in an anonymous function - whether that wrapping is done with the `#(...)` reader syntax or explicitly constructed with `fn`.
Re: Learning Clojure: comparing with Java streams
#6It seems strange to me that `(map extract-name justice-league)` isn't listed under "idiomatic improvements." Supposing you already had `extract-name` defined for some reason, it's cleaner and simpler to just map that unary function than wrap that function in an anonymous function - whether that wrapping is done with the `#(...)` reader syntax or explicitly constructed with `fn`.
Re: Learning Clojure: comparing with Java streams
#7Re: Learning Clojure: comparing with Java streams
#8> and Clojure’s syntax is pretty limited Erm, what? I am confused by the use of the word 'limited' in this context.
Re: Learning Clojure: comparing with Java streams
#9> and Clojure’s syntax is pretty limited Erm, what? I am confused by the use of the word 'limited' in this context.
Re: Learning Clojure: comparing with Java streams
#10 (->> justice-league
(map #(:vehicles %))
(filter #(not (nil? %)))
(flatten))
can be simplified to just `(mapcat :vehicles justice-league)`