Re: beginner (fn) doubt

2015-01-03 Thread Erik Price
((fn [x] (* 5 x)) 5) is the same as (def my-function (fn [x] (* 5 x))) (my-function 5) ​ On Fri, Jan 2, 2015 at 8:13 PM, novato wrote: > I choose clojure as my first programming language after some research. I > am learning by doing Clojure Koans exercises. > I

Re: beginner (fn) doubt

2015-01-03 Thread Anthony Urena
It might help you understand what's going on to bind the fn to a name and poke at it a bit: (let [by-five (fn [x] (* 5 x))] [(by-five 5) (by-five 6) (by-five 7)]) ;; => [25 30 35] This results in a vector wi

Re: beginner (fn) doubt

2015-01-02 Thread Fluid Dynamics
On Friday, January 2, 2015 8:13:41 PM UTC-5, novato wrote: > > I choose clojure as my first programming language after some research. I > am learning by doing Clojure Koans exercises. > I reached to the functions "lesson" and I have a doubt on the following > code: > (

beginner (fn) doubt

2015-01-02 Thread novato
I choose clojure as my first programming language after some research. I am learning by doing Clojure Koans exercises. I reached to the functions "lesson" and I have a doubt on the following code: ((fn [x] (* 5 x)) 5) Why is that the last 5 is outside the fn parenthes