On Thu, Jul 5, 2012 at 1:11 PM, Jacobo Polavieja <jacobopolavi...@gmail.com> wrote: > 1. What is the value of that [new-yx] ?
The value of `new-yx` in the anonymous function that is used with `filter` is whatever value `filter` is invoking the function with from its second argument. In this case, the second argument is a sequence created by the `map` function. To simplify things... (filter (fn [x] (even? x)) [1 2 3 4]) ;=> (2 4) This can be simplified to `(filter even? [1 2 3 4])` but the above example is to help show how `x` is used. > 2. I also don't understand which value that '%' refers to inside de every? > and what exactly that #(< -1 % size) new-yx)) does, although it should be > pretty simple. #() is just another way to create an anonymous function. The % means the first argument passed into the function when invoked. (= x (#(%) x)) ;=> true > 3. More or less the same with the last two "map". I don't know why it > shouldn't suffice with something like (map #(+ yx %) deltas). This is because deltas is a vector of vectors. The first invocation of `map` deals with the outer vector, while the inner invocation deals with each inner vector. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en