A brief addendum to my last post about Clojure’s threading macros.
As I was saying …
I said you could use
as-> to work around the placement of an argument that doesn’t quite fit into a larger pattern of
->. My example was:
(-> results :matches (as-> matches (filter winning-match? matches)) (nth 3) :scores (get "total_points"))
This is not a good example, because
filter is a lazy sequence function that should more properly be used with
->>. And I warned explicitly against mixing
Here’s a better example.