Refactor random number generation to factory

- Use a `make-random` factory to create isolated random number
  generators.
- Remove the global `prng` from the `Environment`.
- Ensure `make-random` can be called with or without a seed.
This commit is contained in:
Michael Schimmel
2026-03-02 14:01:36 +01:00
parent f3459baf43
commit a4af142719
4 changed files with 49 additions and 38 deletions
+3 -3
View File
@@ -1,10 +1,10 @@
;; Benchmark: 2.0us
;; Benchmark-Repeat: 1015
;; Benchmark: 3.0us
;; Benchmark-Repeat: 593
;; Output: PipelineNode[last: Some(110.45243843391206)]
(do
;; Set the random seed to match the existing test output exactly
(seed! 42)
(def random (make-random 42))
;; Use our new generic create-ticker to pulse 3 times
(def cnt 3)