3 comments

[ 3.3 ms ] story [ 36.3 ms ] thread
Am I missing something here or does the article open with a false statement:

   Consider a Clojure function (fn [x] (+ (* x x) 4)).
   The set of allowed values for x is called the domain
   of the function. For value 2, for example, the result
   is 16. We say that the image of 2 is 16.
As far as I can see the image of 2 is 8 for that function - and I don't even program in Clojure. A Clojure repl [1] agrees:

   >  (defn squaredplusfour[x] (+ (* x x) 4))
   #'sandbox11276/squaredplusfour
   > (squaredplusfour 2)
   8

 [1] http://www.tryclj.com/
Yep looks like a simple mistake.

> and I don't even program in Clojure

Congrats, you just did! :)