> (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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---