Re: Guaranteed way to initialize determinized random port
Wolfgang Corcoran-Mathe 15 May 2026 22:56 UTC
Shiro,
Thanks very much for your feedback.
As John pointed out, the idea is that you can obtain the minimum size
of a library's initialization vector by taking the size of an arbitrary
state, e.g.
(bytevector-length (random-port-state rp)),
where *rp* is any random port constructed by the library's
'make-random-port' procedure. If this still seems clumsy, we
could add a constant, say 'random-port-minimum-initialization-size',
which would provide this value explicitly.
(Before the first draft, John & I discussed making it undefined behavior
to mutate the bytevector returned by 'random-port-state'. I forgot
about this until your email reminded me. I think this will be in the
next draft, since it makes it even cheaper to get the size of a random
port state.)
Thanks again.
--
Wolfgang Corcoran-Mathe <xxxxxx@sigwinch.xyz>