If I define a function that returns such a function:
(defn add-n [n] (fn [x] (+ xn)))
Then I can assign the result to the symbol:
(def add-1 (add-n 1))
and name it:
(add-1 41) ;=> 42
How can I call the result (add-n 1)
without assigning it a new character? The following produces this conclusion:
(println (add-n 1)) #<user$add_n$fn__33 user$add_n$fn__33@e9ac0f5 > nil
#<user$add_n$fn__33 user$add_n$fn__33@e9ac0f5 >
is an internal reference to the generated function.
Ralph
source share