I saw that clojure has loop. But in other functional languages, using loops are always discouraged. So I didn't know if loop was the "clojure" idiomatic way of doing this.
On Tue, Jun 2, 2009 at 11:52 AM, Konrad Hinsen <konrad.hin...@laposte.net> wrote: >> My first reaction was to do it using a sequence. Is this the clojure >> idiomatic way to convert a while loop from other languages? > > Clojure has loops as well: > > (let [size 10] ;made up > (loop [max 2] > (if (or (>= (/ max (Math/log max)) size) > (>= max Integer/MAX_VALUE) > (<= max 0)) > max > (recur (* 2 max))))) > > Konrad. > > > > -- Omnem crede diem tibi diluxisse supremum. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---