adding type checks for random-source-make-*

This commit is contained in:
Alex Shinn 2017-01-14 15:08:14 +09:00
parent f691ae6a76
commit 2735b36c87

View file

@ -3,8 +3,12 @@
;; 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)))