|
|
|
|
|
by _dain_
1114 days ago
|
|
In real Lisp code you'd likely indent it something like this: (%
(-
(+ (* x 2)
1)
3)
x)
This makes the structure clearer, although it's still wasteful of space, and you still have to read it "inside-out". The thread macro version would be: (-> x
(* 2)
(+ 1)
(- 3)
(% x))
It's more compact, there's no ambiguity about order-of-operations, and we can read it in order, as a list of instructions:"take x, times it by 2, add one, subtract 3, take modulus with the original x". It's pretty much how you'd type it into a calculator. EDIT: care to explain the downvote? |
|
(defn run-analysis [path]
;;Run the whole thing(time (run-analysis arrow-path))
This code processes 27 million lines in 75 seconds (shout out to https://techascent.github.io/tech.ml.dataset/100-walkthrough... library)