Changeset 33848 in project for release/4/srfi27/trunk/srfi27.scm
 Timestamp:
 02/11/17 16:41:38 (3 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

release/4/srfi27/trunk/srfi27.scm
r19077 r33848 75 75 (defineparameter currententropysource defaultentropysource 76 76 (lambda (x) 77 (cond ((entropysource? x) x) 78 (else 79 (warningargumenttype 'currententropysource x 'entropysource) 80 (currententropysource) ) ) ) ) 81 77 (cond 78 ((entropysource? x) 79 x) 80 (else 81 (warningargumenttype 'currententropysource x 'entropysource) 82 (currententropysource) ) ) ) ) 83 84 (define makeentropysource 85 (caselambda 86 (() 87 ((@entropysourceconstructor (currententropysource))) ) 88 ((es) 89 (let ((ctor 90 (cond 91 ((entropysource? es) 92 (@entropysourceconstructor es) ) 93 ((symbol? es) 94 (let ((ctor (registeredentropysource es))) 95 (or 96 ctor 97 (error 'makeentropysource "unregistered entropysource name" es) ) ) ) 98 (else 99 (errorargumenttype 100 'makeentropysource es 101 "valid entropysource or registered entropysource name") ) ) ) ) 102 (ctor) ) ) ) ) 103 104 #; 82 105 (define (makeentropysource #!optional (es (currententropysource))) 83 106 (let ((ctor 84 107 (cond 85 ((entropysource? es) (@entropysourceconstrutor es) ) 86 ((symbol? es) (registeredentropysource es) ) 108 ((entropysource? es) 109 (@entropysourceconstructor es) ) 110 ((symbol? es) 111 (registeredentropysource es) ) 87 112 (else 88 113 (errorargumenttype … … 93 118 (define (newentropysource es) 94 119 (checkentropysource 'newentropysource es) 95 ((@entropysourceconstru tor es)) )120 ((@entropysourceconstructor es)) ) 96 121 97 122 (define (entropysourcename es) … … 131 156 (lambda (n) 132 157 (checkcardinalinteger 'makeu8vector n 'length) 133 (u8vectorfilled! (makeu8vector n) (lambda () ( modulo (rndint)256))) ) ) )158 (u8vectorfilled! (makeu8vector n) (lambda () (rndint 256))) ) ) ) 134 159 135 160 (define (*randomsourcemakef64vectors rs prec) … … 159 184 (defineparameter currentrandomsource defaultrandomsource 160 185 (lambda (x) 161 (cond ((randomsource? x) x) 162 (else 163 (warningargumenttype 'currentrandomsource x 'randomsource) 164 (currentrandomsource) ) ) ) ) 165 186 (cond 187 ((randomsource? x) 188 x) 189 (else 190 (warningargumenttype 'currentrandomsource x 'randomsource) 191 (currentrandomsource) ) ) ) ) 192 193 (define makerandomsource 194 (caselambda 195 (() 196 ((@randomsourceconstructor (currentrandomsource))) ) 197 ((es) 198 (let ((ctor 199 (cond 200 ((randomsource? es) 201 (@randomsourceconstructor es) ) 202 ((symbol? es) 203 (registeredrandomsource es) ) 204 (else 205 (errorargumenttype 206 'makerandomsource es 207 "valid randomsource or registered randomsource name") ) ) ) ) 208 (ctor) ) ) ) ) 209 210 #; 166 211 (define (makerandomsource #!optional (es (currentrandomsource))) 167 212 (let ((ctor 168 213 (cond 169 ((randomsource? es) (@randomsourceconstrutor es) ) 170 ((symbol? es) (registeredrandomsource es) ) 214 ((randomsource? es) 215 (@randomsourceconstructor es) ) 216 ((symbol? es) 217 (registeredrandomsource es) ) 171 218 (else 172 219 (errorargumenttype … … 177 224 (define (newrandomsource es) 178 225 (checkrandomsource 'newrandomsource es) 179 ((@randomsourceconstru tor es)) )226 ((@randomsourceconstructor es)) ) 180 227 181 228 (define (randomsourcename rs)
Note: See TracChangeset
for help on using the changeset viewer.