Debian Codegraph @

%3a27/random-bits.sls

raw
1 #!r6rs
2 ;; Copyright 2010 Derick Eddington. My MIT-style license is in the file named
3 ;; LICENSE from the original collection this file is distributed with.
4
5 (library (srfi :27 random-bits)
6 (export
7 random-integer
8 random-real
9 default-random-source
10 make-random-source
11 random-source?
12 random-source-state-ref
13 random-source-state-set!
14 random-source-randomize!
15 random-source-pseudo-randomize!
16 random-source-make-integers
17 random-source-make-reals)
18 (import
19 (rnrs)
20 (rnrs r5rs)
21 (only (srfi :19 time) current-time time-nanosecond)
22 (srfi :23 error tricks)
23 (srfi private include))
24
25 (define-record-type (:random-source :random-source-make :random-source?)
26 (fields state-ref
27 state-set!
28 randomize!
29 pseudo-randomize!
30 make-integers
31 make-reals))
32
33 (define (:random-source-current-time)
34 (time-nanosecond (current-time)))
35
36 (SRFI-23-error->R6RS "(library (srfi :27 random-bits))"
37 (include/resolve ("srfi" "%3a27") "mrg32k3a-a.scm")
38 (include/resolve ("srfi" "%3a27") "mrg32k3a.scm"))
39 )