Proposed solution to the "predetermined states" problem Wolfgang Corcoran-Mathe (22 May 2026 23:18 UTC)
Re: Proposed solution to the "predetermined states" problem Wolfgang Corcoran-Mathe (22 May 2026 23:26 UTC)
Re: Proposed solution to the "predetermined states" problem Peter McGoron (23 May 2026 00:02 UTC)
Re: Proposed solution to the "predetermined states" problem Peter McGoron (23 May 2026 01:18 UTC)
Re: Proposed solution to the "predetermined states" problem Peter McGoron (23 May 2026 13:44 UTC)
Re: Proposed solution to the "predetermined states" problem Wolfgang Corcoran-Mathe (23 May 2026 15:15 UTC)
Re: Proposed solution to the "predetermined states" problem Wolfgang Corcoran-Mathe (23 May 2026 16:28 UTC)
Re: Proposed solution to the "predetermined states" problem Peter McGoron (23 May 2026 17:00 UTC)
Re: Proposed solution to the "predetermined states" problem Peter McGoron (23 May 2026 17:02 UTC)
Re: Proposed solution to the "predetermined states" problem Wolfgang Corcoran-Mathe (24 May 2026 17:15 UTC)

Re: Proposed solution to the "predetermined states" problem Wolfgang Corcoran-Mathe 23 May 2026 16:28 UTC

On 2026-05-22 20:47 -0400, John Cowan wrote:
> Make-constant-port is trivial in R6RS:
>
> (define (make-constant-port n)
>   (make-custom-binary-input-port
>     (lambda (bvec start count)
>       #| loop to fill part of bvec |#) #f #f #f)))

Thanks.  I had, in fact, completely forgotten about R6RS custom
ports until now.  I'll try to contribute a portable R6RS sample
implementation with the next draft.

You're right that the solution I proposed would give you only 255
predetermined states, one for each non-zero constant binary port.
In practice, I doubt anyone will need that many states.  (Remember,
this is *only* relevant if you can't / won't save port states to
disk.  In the absence of that restriction, you can have as many saved
states as your storage will allow.)  Still, it's an ugly fact that
makes the constant-port approach look a bit hacky.

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