The evaluation of the function call (func1 x y)
is done once in each case.
The rule for evaluating a function call in Clojure consists of evaluating all the expressions that are provided as its arguments and then invoking the function with those values.
If you define the following higher order function:
(defn plus []
(println "calling plus")
+)
And then call reduce in the following way:
(reduce (plus) [0 1 2 3])
A single calling plus
is printed, showing the function plus
is invoked only once.
The same thing happens when using the let
form:
(let [f (plus)]
(reduce f [0 1 2 3]))
Hope it helps.