mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 21:59:17 +02:00
14 lines
465 B
Scheme
14 lines
465 B
Scheme
;; constructors.scm -- random function constructors
|
|
;; Copyright (c) 2009 Alex Shinn. All rights reserved.
|
|
;; BSD-style license: http://synthcode.com/license.txt
|
|
|
|
(define (random-source-make-integers rs)
|
|
(if (not (random-source? rs))
|
|
(error "not a random source" rs))
|
|
(lambda (n) (%random-integer rs n)))
|
|
|
|
(define (random-source-make-reals rs . o)
|
|
(if (not (random-source? rs))
|
|
(error "not a random source" rs))
|
|
(lambda () (%random-real rs)))
|
|
|