I translated some examples from the book "The Haskell Road" (http:// homepages.cwi.nl/~jve/HR/): (defn naturals [] (iterate inc 0)) (def evens1 (for [n (naturals) :when (even? n)] n)) (def odds1 (for [n (naturals) :when (odd? n)] n)) (def evens2 (for [n (naturals)] (* 2 n))) (def small-squares1 (for [n (range 0 1000)] (* n n))) (def small-squares2 (for [n (naturals) :when (< n 1000)] (* n n))) ; Maybe should use :while instead?
Are these appropriate for inclusion on the Wikibook API page (http:// en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples) since they are derived from a copyrighted book? Aloha, David Sletten --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---