You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I might be misunderstanding what choose-with-frequencies does. I was trying to make a generator that produces integers or symbols at random. I did this:
I just ran into this problem, the issue is a bug in the pick function where the recursive call fails to pass the cdr of the generator list, so ultimately always picks the first one. It also explains why passing 0 as the first frequency causes an infinite loop.
I might be misunderstanding what
choose-with-frequencies
does. I was trying to make a generator that produces integers or symbols at random. I did this:But I get 100 integers, followed by "OK, passed 100 tests."
Also, if I reduce the frequency of the first option to 0, it runs forever.
Is this expected? Is it possible to make a generator that produces different kinds of values randomly?
The text was updated successfully, but these errors were encountered: