On Thu, Jul 5, 2012 at 10:35 AM, Sean Corfield <seancorfi...@gmail.com> wrote:
> (defn inc-by [n x] (+ n x))
>
> (defn inc-all-by [n xs] (map (partial inc-by n) xs))

Ugh! Got this wrong. #(map + yx %) is adding elements of yx and
elements of the argument, not just adding a single value. Sorry.

(defn inc-pairs [ns xs] (map + ns xs))

Then:

(defn neighbors
    ([size yx] ...)
    ([deltas size yx]
        (filter (partial all-in-range -1 size)
            (map (partial inc-pairs yx) deltas))))

Hopefully it's correct this time!
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

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