John,
Thanks for proofreading, yet again.
On 2026-06-04 01:16 -0400, John Cowan wrote:
> Typo: "determinzed".
Fixed.
> > Two determinized random ports with the same states must produce the same
> sequence of pseudorandom numbers.
>
> Add "(in the sense of equal?)" after "same".
I realized today that we need to add an equality predicate for
random-port states, since 'equal?' will not work portably on homogeneous
numeric vectors, which are the mostly likely types for the purpose. So
I will add "(in the sense of random-port-state=?)", instead.
> Clarify that this only applies to random ports created with the same
> library.
Good point. I'll fix this, and look for other passages in the SRFI in
need of similar clarification.
> > if two initializer ports produce the same sequences, then the random
> ports initialized from them should have the same initial states.
>
> I think this should be "must".
Yes, it should be.
> > Returns an immutable random-state object
>
> This should make it an error to mutate the state object rather than
> demanding that it be immutable, which prohibits the use of lists, vectors,
> and bytevectors.
I was writing R6-ese here, in which 'symbol->string' returns "an
immutable string". But the rest of the SRFI is in R7, so this should
be changed.
> > Example determinized library names
>
> I suggest adding (srfi 271 determinized srfi 27), which is defined to
> produce the same sequence of random bytes as calling (random-integer 256)
> from the local implementation of SRFI 27.
That's easy to add to a purely informational section, but what would be
the utility of such a library?
> > wrapping a random port in a record type
>
> Add "or SRFI 111 box".
If I read SRFI 27 aright, this wouldn't be correct. Random sources
can't also be boxes.
> Multiple randomized random port libraries make sense when multiple
> deterministic generation algorithms seeded from a high-entropy external
> source or multiple high-entropy external sources are provided. This SRFI
> should say so, and list sample names like (... drbg hmac), (... drbg hash),
> (... drbg counter), (... chacha20), (... /dev/random), (... /dev/urandom),
> (... BCryptGenRandom), (... Fortuna), and (... hardware).
Good idea. The "sample library names" section should be expanded to
include some randomized libraries.
Thanks again.
--
Wolfgang Corcoran-Mathe <xxxxxx@sigwinch.xyz>