chibi-scheme/lib/srfi/27/constructors.scm
2017-01-14 15:08:14 +09:00

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)))