Re: Proposed solution to the "predetermined states" problem
Wolfgang Corcoran-Mathe 03 Jun 2026 16:10 UTC
On 2026-06-03 11:42 -0400, Wolfgang Corcoran-Mathe wrote:
> On 2026-06-03 11:04 -0400, Peter McGoron wrote:
> > On 5/24/26 13:14, Wolfgang Corcoran-Mathe wrote:
> > > Unfortunately, the SRFI's claim that a portable implementation is
> > > impossible remains true: most of SRFI 271 be implemented with
> > > 'make-custom-binary-input-port', but not the 'random-port-state'
> > > accessor. So close!
> >
> > Wouldn't this be implementable with a custom `get-position` in
> > `make-custom-binary-input-port`? Then `random-port-state` is just
> > `port-position`. (In a sense, a state *is* the position of the port,
> > it's just not an integer. R6RS explicitly supports such a scenario.)
>
> For binary input ports, the position is an exact integer.
Of course, you *could* use exact integers for your random port states.
But this is probably not what port readers expect, since the "position"
may fluctuate wildly with each read.
--
Wolfgang Corcoran-Mathe <xxxxxx@sigwinch.xyz>