Re: Initial comments on 3rd draft
Peter McGoron 05 Jun 2026 11:46 UTC
> 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.
I still don't get why that's necessary, as
1) extension of equal? to read/write invariant values is a very common
extension, even if it isn't outright required by the SRFI spec,
2) the representation of a random port state is a choice made by an
implementer and this SRFI is not portably implementable (yet). The
implementer would know the acceptable datum/equal? types on their
implementation.
In general one has to copy the random port state when calling
`random-port-state`: it can't share state with the random port because
the random port will be updating the state every random number it
generates. Given that a copy usually happens, serializing a number
vector to a bytevector in that step is not that much more effort for an
implementation that must.
-- Peter McGoron