On Tue, Jul 8, 2014 at 11:38 AM, Cecil Westerhof <cldwester...@gmail.com> wrote: > I al-ready tried something along those lines: > (defn error-in-datastruct-p [] > (let [errors (atom ())] > (if (= (count objects) (count *object-locations*)) > (map (fn [x] > (println x) > (if (not (*object-locations* x)) > (do > (println x) > (swap! errors conj (remove-symbol-from-output > `(No location for ~x))) > @errors > ) > )) > objects) > (swap! errors conj '(Number of objects and number of object > locations is not the same.))) > @errors)) > > (error-in-datastruct-p) > > This gives: > user=> user=> () > > When I only remove the last @errors, I get: > user=> user=> (whiskey > bucket > nil chain > nil frog > nil pole > pole > nil ((No location for pole))) > > > What could be happening here?
You're discarding the result of the (if ...) because it is directly followed by @errors and as a result the lazy evaluation of (map ...) is not happening, and your println and errors updates does not get executed. Lars Nilsson -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.