On Mon, Jan 9, 2012 at 1:56 PM, Linus Ericsson
<oscarlinuserics...@gmail.com> wrote:
> the last one becomes something like this:
>
> (for [option modified-options action modified-actions]
>    (if (= (:name option) (:name option))
>       (let [sum (+ (:value action) (:value option))]
>          [{:name (:name option) (Math/max 0 sum)} {:name (:name option)
> (Math/min 0 sum)}])))

The original code modifies the options and actions in place so the
actions are cumulative on the options. Your Clojure code does not have
that same property and produces different results.

I'll be interested to see what Clojure solutions folks come up with
that give the same results. I'm having a hard time with the solution
myself :(
-- 
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