"Rob Lachlan" <robertlach...@gmail.com> wrote: >Actually, Mike, your two functions work just fine. (Equal branch). >Mind you I checked that out over two hours ago, so this information >might be out of date. > >Rob > >On Jun 19, 6:59 pm, Mike Meyer <mwm-keyword-googlegroups.
Ok, why does this work but the fact fail? Or does the fact example still fail on that build? The fact that this requires explanation is a pretty good argument the fact behavior. >> (defn count-in [value col] >> (loop [value value col col res 0] >> (if (empty? col) >> res >> (recur value (rest col) (if (= (first col) value) (inc res) >> res))))) >> >> (defn ones-n-zeros [vectors] >> (loop [vectors vectors m-zeros 0 m-ones 0] >> (if (empty? vectors) >> [m-zeros m-ones] >> (let [data (first vectors) >> zeros (count-in 0 data) >> ones (count-in 1 data)] >> (recur (rest vectors) (if (> zeros ones) (inc m-zeros) m-zeros) >> (if (> ones zeros) (inc m-ones) >> m-ones)))))) -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. -- 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