apply and map in clojure
It is a very confusing comparison between
The famous function
map means to call function provided to each element in collection once at a time.
There are 3 elements in
println for each element.
appy just call function once, but extract all elements from collection before calling.
Here only has 1 line of printing.
Some more experiments:
Obviously, apply extracts elements from collection.
26 April 2015