On Mon, Aug 27, 2012 at 2:50 AM, Stefan Monnier wrote: > > Therefore the PRNG should be seeded once at start-up, from a good > > source of entropy. > > IIRC Emacs fails to seed its PRNG at start (IOW it is seeded with > a constant), which is why many packages use (random t). > > So I think the right thing to do now is to do seed it at startup, then > make (random t) a no-op. > > We could consider adding a way to get the PRNG state and reset it later, > but since the PRNG state is Emacs-wide and Emacs is more like an OS than > like an application w.r.t its packages, such an interface would need to > allow several named PRNGs, so you'd call (random N ) to get the next > "random" number from 's stream. What about implementing the Common Lisp conventions for treating PRNG state, i.e. an optional state argument to RANDOM, and a variable *RANDOM-STATE*? Instead of (RANDOM T), people could say something like (SETQ *RANDOM-STATE* (MAKE-RANDOM-STATE T)) if they really want. -- Simon.