Thanks for your response guys. Ruben
On Jul 21, 9:30 am, Stuart Halloway <stuart.hallo...@gmail.com> wrote: > Hi Ruben, > > What you are missing is thatmapis the wrong function to use here.Mapis lazy, > and combiningmapwith something side-effecty like println will lead to > confusion. > > doseq will give you what you want. > > Stu > > Stuart Halloway > Clojure/corehttp://clojure.com > > > > > Hi all, > > > when I execute the following code: > > > (def users (ref [])) > > > ;works > > (defn print-users [] > > (with-query-results res ["select id,username,password from users" ] > > > (dorun > > (dosync (ref-set users res ) ) > > ) > > ) > > ) > > > and then execute (map#(println %) @users) i get back this: > > > ({:id 1, :username rpierich, :password test} > > {:id 2, :username ruthpierich, :password test} > > nil {:id 3, :username ruthpierich, :password test} > > nil nil) > > > when i perform a @users i get: > > > ({:id 1, :username "rpierich", :password "test"} {:id 2, :username > > "ruthpierich", :password "test"} {:id 3, :username > > "ruthpierich", :password "test"}) > > > Is this abugwithmapor since it adds on those nils or am i missing > > something in the call tomap? > > > Cheers, > > Ruben > > > -- > > 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 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