> (defn seq-of-rand-strings [maxlength] > (repeatedly (fn [] > (apply str (take (rand-int maxlength) > (repeatedly #(char (+ (int \a) (rand-int 26))))))))) > > user=> (take 3 (seq-of-rand-strings 10)) > ("kae" "xwuwyp" "xa")
Thanks Chouser. I learned some useful and interesting things from your reply. I was unaware of 'char and 'repeatedly. Gavin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---