On Friday, July 6, 2012 2:50:00 AM UTC+2, Benny Tsai wrote:
>
> Indeed!  You can use ->> (like ->, but inserts into the last position of 
> each form) to do something like:
>
> (defn neighbors
>   ([size yx]
>      (neighbors [[-1 0] [1 0] [0 -1] [0 1]] size yx))
>   ([deltas size yx]
>      (let [in-matrix? (fn [new-yx] (every? #(< -1 % size) new-yx))]
>        (->> deltas
>             (map #(map + yx %))
>             (filter in-matrix?)))))
>

It may be due to my background, but that I understand or feel a lot better 
:). I suppose as time passes and I see more and more Clojure code that will 
change anyway.

I know this is going very offtopic, but why did you use "let" define 
"in-matrix?" instead of a defn? That's another thing I'm finding a little 
bit confusing... in F# you just use "let" for everything", in Haskelll you 
don't type anything. So, why would it be more appropiate?

Thanks a lot!

-- 
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

Reply via email to