2 ms·
Dart looks very elegant. You didn't include "group all the articles based on the author". Would that be equally clean in Dart? Here's the Clojure version: ;
by markc 12y ago
Dart looks very elegant. You didn't include "group all the articles based on the author". Would that be equally clean in Dart?
Here's the Clojure version:
;; given articles = [{:title "t1" :author "a1" :tags #{:t1 :t2}} .. etc. ]
;; These 4 Clojure one-liners replace all the J8 code examples in the article.
(first (filter #(contains? (:tags %) :Java) articles))
(filter #(contains? (:tags %) :Java) articles)
(group-by :author articles)
(apply clojure.set/union (map :tags articles))