[squeak-dev] What is happening here?
Louis LaBrunda
Lou at Keystone-Software.com
Mon Apr 4 14:28:20 UTC 2022
Hi Stéphane,
Please don't take this the wrong way, I'm just trying to nudge you in the right direction. Try looking at the
size/contents of #s after "10 timesRepeat: [s add: b]".
Lou
On Mon, 4 Apr 2022 16:19:59 +0200, Stéphane Rollandin <lecteur at zogotounga.net> wrote:
>Hello all,
>
>I just spent an hour or so chasing a strange glitch in my game, which
>makes a massive usage of Random, and the culprit is as follow:
>
>
>1) This, as expected, yields a Set of 10 different numbers:
>
> | b s |
>
> b := [Random new].
> s := Set new.
> 10 timesRepeat: [s add: b value next].
> s
>
>
>2) This yields a Set of one single number:
>
> | b s |
>
> b := [Random new].
> s := Set new.
> 10 timesRepeat: [s add: b].
> s collect: [:d | d value next]
>
>
>Unless I am missing something, this looks like a pretty serious bug.
>
>Tested in the latest trunk image, on win 64.
>
>Stef
>
--
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
More information about the Squeak-dev
mailing list
|