open:threading-macro

Threading Macro

Navigation, Transformation, and Sequence: That's it for the “do's.” The rest are all “don'ts.”

;; BAD
(-> results
    :matches
    (#(filter wining-match? %)) ; BAD
    (nth 3)
    :scores
    (get "total_points"))
 
;; BETTER
(let [wins (filter winning-match? (:matches results))]
  (-> wins
      (nth 3)
      :scores
      (get "total_points")))

  • open/threading-macro.txt
  • 마지막으로 수정됨: 2022/02/25 13:23
  • 저자 127.0.0.1