Interface for random numbers #6
jeroenvandijk
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
Can you name a few existing implementation for which tools.misc should have a facade? Is there something in the JDK that can already be used and why would one want to replace this with another impl? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Usage of
(rand)
,(rand-int n)
, etc are already standardized in Clojure code, but it doesn't give us control over the random seed. Therefore any reliance on random numbers in a library make a program harder to control in a test environment.If we would have
clj-easy.tools.random
withrand
,rand-int
etc and being able to choose the provider we might give this control back to the user. Like withtest.check
we will be able to set a seed and this gives us reproducable/deterministic tests (and output)Some remarks
Beta Was this translation helpful? Give feedback.
All reactions