[MLton] cvs commit: rewrite of MLton.Random.alphaNumString

Jesper Louis Andersen jlouis@mongers.org
Mon, 29 Dec 2003 00:28:54 +0100


Quoting Stephen Weeks (sweeks@mlton.org):

>   Used Matthew's (excellent) suggestion to compute the refresh period.
>   Also added alphaNumChar, which will save even a few more random bits.
>   Please check for errors :-).

Seems fine from here. The control is more readable now than before
I think. Did you also commit something along the lines of:

--- extensions.tex.orig	2003-12-29 00:22:53.000000000 +0100
+++ extensions.tex	2003-12-29 00:25:24.000000000 +0100
@@ -553,6 +553,7 @@
 signature MLTON_RANDOM =
    sig
       val alphaNumString: int -> string
+      val alphaNumChar: unit -> char
       val rand: unit -> word
       val seed: unit -> word option
       val srand: word -> unit
@@ -564,6 +565,9 @@
 \entry{alphaNumString n}
 return a string of length {\tt n} of random alphanumeric characters.
 
+\entry{alphaNumChar ()}
+return a random char
+
 \entry{rand ()}
 return the next pseudrandom number.
 
to the user-guide documentation? I think we ought to tell people that
there is a function here that might be useable to them.

-- 
j.