Re:Learning Clojure: comparing with Java streams
by vlaaad on Sunday November 04, 2018 @02:24PM
(#18377591)
Also, this bit:
can be simplified to just `(mapcat :vehicles justice-league)`
[ Parent
| on HN ]
Re:Learning Clojure: comparing with Java streams
by adambard on Sunday November 04, 2018 @04:24PM
(#18378135)
A few notes on why this is so:
- Keywords (i.e. `:vehicles`) can be used as getter functions, as covered in the OP.
- mapcat (like most collection functions in clojure) treats `nil` as an empty sequence