mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
adding type checks for random-source-make-*
This commit is contained in:
parent
f691ae6a76
commit
2735b36c87
1 changed files with 4 additions and 0 deletions
|
@ -3,8 +3,12 @@
|
||||||
;; BSD-style license: http://synthcode.com/license.txt
|
;; BSD-style license: http://synthcode.com/license.txt
|
||||||
|
|
||||||
(define (random-source-make-integers rs)
|
(define (random-source-make-integers rs)
|
||||||
|
(if (not (random-source? rs))
|
||||||
|
(error "not a random source" rs))
|
||||||
(lambda (n) (%random-integer rs n)))
|
(lambda (n) (%random-integer rs n)))
|
||||||
|
|
||||||
(define (random-source-make-reals rs . o)
|
(define (random-source-make-reals rs . o)
|
||||||
|
(if (not (random-source? rs))
|
||||||
|
(error "not a random source" rs))
|
||||||
(lambda () (%random-real rs)))
|
(lambda () (%random-real rs)))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue