3 ms·
Clojure has threading macros that turn (function(function(function) into (-> function function function) An interesting take on that is a
by michaelmrose 9y ago
Clojure has threading macros that turn
(function(function(function) into
(-> function
function
function)
An interesting take on that is a library called swiss arrows that lets you do
(-<> (function arg1 <>)
(function <> arg2)
(function arg1 arg2 <>)
Using the <> to indicate where the result of calling one shall be threaded into the next.
- robto 9y agoThat's in the standard library, actually. It's called as->. (as-> value <> (function1 arg1 <>) (function <> arg2) (function arg1 arg2 <>))
- michaelmrose 9y agoFound the old swiss arrows and didn't realize that as-> even existed thank you.