3 ms·
I also think that the object-oriented syntax matches my thinking process more closely: for example, I have an array of strings, and I want to convert them to nu
by saagarjha 7y ago
I also think that the object-oriented syntax matches my thinking process more closely: for example, I have an array of strings, and I want to convert them to numbers, pick only the odd ones then sum them rather than "I want to sum some things…things which I'm filtering by parity…which are actually strings I'm converting to integers".
- scarejunba 7y agoThat's how the thread-last/first macros help in Clojure. You sort of specify a pipeline: ``` (-> list parseInt isOdd sum) ``` Is the same as ``` (sum(isOdd(parseInt(list))) ``` Particularly useful if you're pulling a deeply nested key out.