Changeset 33848 in project for release/4/srfi-27/trunk/srfi-27.scm
- Timestamp:
- 02/11/17 16:41:38 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
release/4/srfi-27/trunk/srfi-27.scm
r19077 r33848 75 75 (define-parameter current-entropy-source default-entropy-source 76 76 (lambda (x) 77 (cond ((entropy-source? x) x) 78 (else 79 (warning-argument-type 'current-entropy-source x 'entropy-source) 80 (current-entropy-source) ) ) ) ) 81 77 (cond 78 ((entropy-source? x) 79 x) 80 (else 81 (warning-argument-type 'current-entropy-source x 'entropy-source) 82 (current-entropy-source) ) ) ) ) 83 84 (define make-entropy-source 85 (case-lambda 86 (() 87 ((@entropy-source-constructor (current-entropy-source))) ) 88 ((es) 89 (let ((ctor 90 (cond 91 ((entropy-source? es) 92 (@entropy-source-constructor es) ) 93 ((symbol? es) 94 (let ((ctor (registered-entropy-source es))) 95 (or 96 ctor 97 (error 'make-entropy-source "unregistered entropy-source name" es) ) ) ) 98 (else 99 (error-argument-type 100 'make-entropy-source es 101 "valid entropy-source or registered entropy-source name") ) ) ) ) 102 (ctor) ) ) ) ) 103 104 #; 82 105 (define (make-entropy-source #!optional (es (current-entropy-source))) 83 106 (let ((ctor 84 107 (cond 85 ((entropy-source? es) (@entropy-source-construtor es) ) 86 ((symbol? es) (registered-entropy-source es) ) 108 ((entropy-source? es) 109 (@entropy-source-constructor es) ) 110 ((symbol? es) 111 (registered-entropy-source es) ) 87 112 (else 88 113 (error-argument-type … … 93 118 (define (new-entropy-source es) 94 119 (check-entropy-source 'new-entropy-source es) 95 ((@entropy-source-constru tor es)) )120 ((@entropy-source-constructor es)) ) 96 121 97 122 (define (entropy-source-name es) … … 131 156 (lambda (n) 132 157 (check-cardinal-integer 'make-u8vector n 'length) 133 (u8vector-filled! (make-u8vector n) (lambda () ( modulo (rndint)256))) ) ) )158 (u8vector-filled! (make-u8vector n) (lambda () (rndint 256))) ) ) ) 134 159 135 160 (define (*random-source-make-f64vectors rs prec) … … 159 184 (define-parameter current-random-source default-random-source 160 185 (lambda (x) 161 (cond ((random-source? x) x) 162 (else 163 (warning-argument-type 'current-random-source x 'random-source) 164 (current-random-source) ) ) ) ) 165 186 (cond 187 ((random-source? x) 188 x) 189 (else 190 (warning-argument-type 'current-random-source x 'random-source) 191 (current-random-source) ) ) ) ) 192 193 (define make-random-source 194 (case-lambda 195 (() 196 ((@random-source-constructor (current-random-source))) ) 197 ((es) 198 (let ((ctor 199 (cond 200 ((random-source? es) 201 (@random-source-constructor es) ) 202 ((symbol? es) 203 (registered-random-source es) ) 204 (else 205 (error-argument-type 206 'make-random-source es 207 "valid random-source or registered random-source name") ) ) ) ) 208 (ctor) ) ) ) ) 209 210 #; 166 211 (define (make-random-source #!optional (es (current-random-source))) 167 212 (let ((ctor 168 213 (cond 169 ((random-source? es) (@random-source-construtor es) ) 170 ((symbol? es) (registered-random-source es) ) 214 ((random-source? es) 215 (@random-source-constructor es) ) 216 ((symbol? es) 217 (registered-random-source es) ) 171 218 (else 172 219 (error-argument-type … … 177 224 (define (new-random-source es) 178 225 (check-random-source 'new-random-source es) 179 ((@random-source-constru tor es)) )226 ((@random-source-constructor es)) ) 180 227 181 228 (define (random-source-name rs)
Note: See TracChangeset
for help on using the changeset viewer.