On Fri, Jan 23, 2009 at 1:11 PM, Stephen C. Gilardi <squee...@mac.com> wrote: > > Please do enter it as an issue. I'd be interested in hearing from Chouser > before making the change. He added combinations to lazy-seqs.
I did what now? My memory must be going. Here are some other implementations I apparently went through: http://paste.lisp.org/display/68701 Reviewing the IRC log from that day, it appears I put no particular thought into then no-args case, so I'm happy to defer to Jason's logic on the matter. This is the best version? (defn combinations "Takes any number of seqs and returns a lazy list of ordered combinations (pick 1 from each seq). See also 'for'" [& seqs] (if (empty? seqs) '(()) (for [item (first seqs) more (apply combinations (rest seqs))] (cons item more)))) --Chouser --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---