Don't launch if you aren't going to monitor
Don't monitor if you aren't going to improve
Don't improve if you don't know who to improve for
Don't launch if you aren't going to monitor
Don't monitor if you aren't going to improve
Don't improve if you don't know who to improve for
=> (interleave [:a :b :c] [1 2 3])
(:a 1 :b 2 :c 3)After I solve this quiz with a long solution, I looked at the other people solution. One of the solution that impressed me somewhat similar to this
=> (apply concat (map vector [:a :b :c] [1 2 3]))
(:a 1 :b 2 :c 3)If we run only evaluate Map part, the result looks like this
=> (map vector [:a :b :c] [1 2 3])
([:a 1] [:b 2] [:c 3])I had hard time to understand that. I got a question in my head. "Of what reason, why Map function take element of 2 vector (3th, 4th parameters) one by one?" It turns out that this is a Clojure Map function behavior.
=> [1, 2, 3].map { |i| i + 1 }
[2, 3, 4]But for Clojure's Map function, it takes variable arguments and behave like what I explained earlier.
=> (map inc [1 2 3])
(2 3 4)
=> (map + [1 2 3] [4 5 6])
(5 7 9)Another question I had was "Can we archive the same variable arguments behavior with Object-Oriented style?"
map(->x,y{ x+y }, [1,2,3], [4,5,6])This examples might look trivial but if we look at it carefully it represents fundamental differences between OO languages and functional languages. For OO language, our method call is a mechanism of passing message to an object. But for functional language, it's just a function call.
I couldn't find this link when searching with google https://www.collectd.org/documentation/manpages/collectd.conf.html#plugin-postgresq...