Depends on what you're doing but one simple way is: (defn for-all [gs] (if (seq gs) (all gs (for-all (rest gs))) s#))
On Thu, Apr 26, 2012 at 1:08 PM, Daniel Kwiecinski < daniel.kwiecin...@gmail.com> wrote: > Is there such standard goal in clojure.logic or do I need to write > something like: > > > (defn for-all > > > > "A goal that succeeds if all goals succeeds." > > > [g p l] > > > (fresh [a d] > > > (conso a d l) > > > (g p a) > > > (for-all g p d))) > > > > If it is the latter, is my proposed solution correct and idiomatic? > > Kind Regards, > Daniel Kwiecinski > > -- > 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