[plt-scheme] A curious evaluation order (?) bug

From: Noel Welsh (noelwelsh at gmail.com)
Date: Sun Dec 30 11:54:26 EST 2007

On Dec 30, 2007 4:13 PM, Doug Williams <m.douglas.williams at gmail.com> wrote:
> Noel,
> I'm a bit confused.  Wouldn't you expect the value of i to be different on
> different runs since it's drawn from a random distribution?

Thanks for the response.  I was setting random-seed to a fixed value
before each call.  This wasn't show in the code I excerpted.  The rest
of your email suggests random-seed is irrelevant.  I'm just about to
look at this problem again, so hopefully I'll get it sorted out soon.
I'll report back.


> The other thing that might be confusing is why the displayed random-discrete
> varies when you set the random-seed.  That is because the science collection
> parameterizes it's default-random-source and is using the SRFI 27 random
> source implementation rather that that build into PLT Scheme.  [At the time
> it was written the PLT Scheme one was very naive.  As of V371, the PLT
> Scheme one uses the same algorithm as SRFI 27 and the SRFI 27 code was
> changed to use the new PLT Scheme implementation.  This caused some breakage
> during the transition, but I think it's been fixed.]  In any case, setting
> the random-seed in PLT Scheme's default random source does not change the
> default-random-source parameter from the science collection.  If you want
> consistent random sources from the science collection, it's best to use
> with-new-random-source (if you need just one) or make-random-source-vector
> (if you need several independent sources).

Posted on the users mailing list.