some->> Erik. -- i farta
> Den 3. nov. 2015 kl. 17.05 skrev Timur <timurha...@gmail.com>: > > Hi all, > > Often I need to make decisions in simple threading macros, for instance > consider the following code > > (->> m > :vector > (filterv #(= (:id %) (:id m))) > (reduce #(and %1 %2))) > > In this case, if the result of filter is empty reduce throws an exception as > it expects some values. Therefore, I want to include a decision between > filter and reduce for instance if empty then add false into the resulting > vector. What would be the best way to achieve this? I could add a function > that checks if empty then add sth into the vector but wanted to ask your > opinions if there is a better way to do this. > > Regards, > > Timur > -- > 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. -- 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.