Re: Clarification of make-random-source-generator
Bradley Lucier 17 Jan 2024 18:58 UTC
On 1/17/24 6:42 AM, Shiro Kawai wrote:
>
> The srfi description of make-random-source-generator reads:
>
> "Each invocation of the generator returns the random source returned by
> passing the value of (current-random-source), i, and successive integers
> j (starting with 0) to the SRFI 27 procedure
> random-source-pseudo-randomize!."
>
> I think there's some error or incompleteness. Passing the value of
> (current-random-source) doesn't make sense, for
> random-source-pseudo-randomize! changes the state of the random source,
> and it does not return a value.
> Following the reference implementation, something like this may be
> appropriate?
>
> "Each invocation of the generator returns a new random source created by
> calling make-random-source (SRFI 27), which is passed to
> random-source-pseudo-randomize! with i, and successive integers j
> (starting with 0), before being returned."
>
I believe you are correct. Your description is what the sample code
does, and what I meant it to do. Sorry it wasn't specified correctly.
Brad