From: Chris Hanson Date: Thu, 14 Oct 1993 10:13:58 +0000 (+0000) Subject: Allow MAKE-RANDOM-STATE to accept #T as an argument. X-Git-Tag: 20090517-FFI~7765 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=a864a484b5f490ba835311878a70d95c8dbc38a5;p=mit-scheme.git Allow MAKE-RANDOM-STATE to accept #T as an argument. --- diff --git a/v7/src/runtime/random.scm b/v7/src/runtime/random.scm index 279be30ca..29a88e801 100644 --- a/v7/src/runtime/random.scm +++ b/v7/src/runtime/random.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: random.scm,v 14.7 1993/10/14 09:44:21 cph Exp $ +$Id: random.scm,v 14.8 1993/10/14 10:13:58 cph Exp $ Copyright (c) 1993 Massachusetts Institute of Technology @@ -104,21 +104,15 @@ MIT in each case. |# (flo:/ element b.))))) (define (make-random-state #!optional state) - (let ((state (if (default-object? state) #f state)) - (new-state - (lambda (n) - (initial-random-state (congruential-rng (+ n 123456789)))))) - (cond ((eq? #t state) - (new-state (real-time-clock))) - ((exact-integer? state) - ;; This case is for upwards compatibility. - (new-state state)) - (else - (let ((state (guarantee-random-state state 'MAKE-RANDOM-STATE))) - (%make-random-state - (random-state-index state) - (random-state-borrow state) - (vector-copy (random-state-vector state)))))))) + (let ((state (if (default-object? state) #f state))) + (if (or (eq? #t state) (exact-integer? state)) + (initial-random-state + (congruential-rng (+ (real-time-clock) 123456789))) + (let ((state (guarantee-random-state state 'MAKE-RANDOM-STATE))) + (%make-random-state + (random-state-index state) + (random-state-borrow state) + (vector-copy (random-state-vector state))))))) (define (initial-random-state generate-random-seed) ;; The numbers returned by GENERATE-RANDOM-SEED are not critical.