News for hackers. Stuff that matters.
Re:For the Love of Pipes by diggan on Tuesday January 22, 2019 @07:25AM (#18967760)
Clojure has something that you could call a pipe almost. `->` passes the output from one form to the next one.

This example has a nested hash map where we try to get the "You got me!" string.

We can either use `:a` (keyword) as a function to get the value. Then we have to nest the function calls a bit unnaturally.

Or we can use the thread-first macro `->`, which is basically a unix pipe.

   user=> (def res {:a {:b {:c "You got me!"}}})
   #'user/res
   
   user=> res
   {:a {:b {:c "You got me!"}}}
   
   user=> (:c (:b (:a res)))
   "You got me!"
   
   user=> (-> res :a :b :c)
   "You got me!"
Thinking about it, Clojure advocates having small functions (similar to unix's "small programs / do one thing well") that you compose together to build bigger things.
Re:For the Love of Pipes by lincpa on Tuesday January 22, 2019 @07:43AM (#18967837)
Clojure: The Pure Function Pipeline Data Flow

https://github.com/linpengcheng/PurefunctionPipelineDataflow

Re:For the Love of Pipes by jacquesm on Tuesday January 22, 2019 @07:48AM (#18967856)
Why are you linking to the same github project over and over again?
Re:For the Love of Pipes by lincpa on Tuesday January 22, 2019 @09:44AM (#18968547)
Sorry, but the system does not support deletion now.