Re: Special initialization behavior for the default determinized library (was: more comments) Wolfgang Corcoran-Mathe 19 May 2026 17:46 UTC

On 2026-05-18 21:00 -0400, John Cowan wrote:
> If you need many rewindable reproducible streams of random numbers, as when
> you want replayable card decks.

As I mentioned on IRC, I can't see how this requires multiple
*predetermined* random states.  A solitaire game can simply save the
initial state of its random port before each game:

    (define (game-loop game-id ...)
      (let ((rng (make-random-port)))
        (save-game-to-file! game-id (random-port-state rng))
        ;; ... play the game
        ))

The only use for multiple "sample" states I can think of is a
situation, similar to Shiro's, in which you need N random ports,
each of which produces a known sequence which is different from
the sequences produced by the other ports.  (In other words, it's
unacceptable to set them all to the same known state, but it's also
unacceptable to set them to randomized states.)  This is so specific
a case that I doubt it's worth supporting.

--
Wolfgang Corcoran-Mathe  <xxxxxx@sigwinch.xyz>