Thanks for all the helpful suggestions guys. I put together a little article on determining coin flipping probability with Clojure. I'm still a newb, but this Google Group is helping me progress with the language.
http://travis-whitton.blogspot.com/2009/08/flipping-coins-with-clojure.html Travis On Aug 18, 7:08 pm, tmountain <tinymount...@gmail.com> wrote: > Hi, I was wondering if there's a more idiomatic way to do the > following: > > (defn flip-coin [] > (int (rand 2))) > > (let [coin-flips (for [x (repeat true)] (flip-coin))] > .... > > Basically I want to generate an infinite lazy sequence based on the > output of a given function with zero or more arguments. Also, this is > a side question, but does anybody know if there's a faster (or better) > way to compare two lazy sequences than the following? > > (defn seq-identical? [seq1 seq2] > (zero? (compare (vec seq1) (vec seq2)))) > > Thanks, > Travis --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---