Changeset 34017 in project for release/4


Ignore:
Timestamp:
04/23/17 11:57:20 (3 years ago)
Author:
Kon Lovett
Message:

error when unregistered source

Location:
release/4/srfi-27
Files:
3 deleted
6 edited
26 copied

Legend:

Unmodified
Added
Removed
  • release/4/srfi-27/tags/3.2.4/source-registration.scm

    r34015 r34017  
    4343
    4444(define (make-source-registration name sources)
    45   (letrec ((reg
    46             (*make-source-registration
    47               (check-symbol 'make-source-registration name "name")
    48               (check-list 'make-source-registration sources "sources")
    49               (lambda ()
    50                 (alist-keys (*source-registration-sources reg)) )
    51               (lambda (name)
    52                 (alist-ref
    53                   (check-symbol 'source-registration-ref name)
    54                   (*source-registration-sources reg)
    55                   eq? #f) )
    56               (lambda (name)
    57                 (*source-registration-sources-set!
    58                   reg
    59                   (alist-delete!
    60                     (check-symbol 'source-registration-deref! name)
    61                     (*source-registration-sources reg)
    62                     eq?)) )
    63               (lambda (name ctor)
    64                 (*source-registration-sources-set!
    65                   reg
    66                   (alist-update!
    67                     (check-symbol 'source-registration-register!! name)
    68                     (check-procedure 'source-registration-register! ctor)
    69                     (*source-registration-sources reg)
    70                     eq?)))) ) )
     45  (letrec (
     46      (reg
     47        (*make-source-registration
     48          ;
     49          (check-symbol 'make-source-registration name "name")
     50          ;
     51          (check-list 'make-source-registration sources "sources")
     52          ;
     53          (lambda ()
     54            (alist-keys (*source-registration-sources reg)) )
     55          ;
     56          (lambda (name)
     57            (alist-ref
     58              (check-symbol 'source-registration-ref name)
     59              (*source-registration-sources reg)
     60              eq?
     61              #f) )
     62          ;
     63          (lambda (name)
     64            (*source-registration-sources-set!
     65              reg
     66              (alist-delete!
     67                (check-symbol 'source-registration-deref! name)
     68                (*source-registration-sources reg)
     69                eq?)) )
     70          ;
     71          (lambda (name ctor)
     72            (*source-registration-sources-set!
     73              reg
     74              (alist-update!
     75                (check-symbol 'source-registration-register!! name)
     76                (check-procedure 'source-registration-register! ctor)
     77                (*source-registration-sources reg)
     78                eq?)))) ) )
    7179    reg ) )
    7280
  • release/4/srfi-27/tags/3.2.4/srfi-27.meta

    r34015 r34017  
    1515        (vector-lib "1.2")
    1616        (numbers "2.8")
    17         (synch "2.1.0"))
     17        (synch "2.1.0")
     18        #;(random-bsd "0.2"))
    1819 (files "mrg32k3a.scm" "srfi-27.meta" "srfi-27-uniform-random.scm" "mwc.scm"
    1920 "srfi-27.setup" "entropy-procedure.scm" "srfi-27.release-info"
     
    2324 "srfi-27-distributions.scm" "srfi-27-vector.scm" "srfi-27.scm"
    2425 "entropy-windows.scm" "moa.scm" "entropy-support.scm"
     26 #;"bsdrnd.scm"
    2527 "source-registration.scm" "tests/test-diehard.scm" "tests/test-confidence.scm"
    2628 "tests/test-mrg32k3a.scm" "tests/run.scm" "entropy-port.scm") )
  • release/4/srfi-27/tags/3.2.4/srfi-27.scm

    r34015 r34017  
    8989              (registered-entropy-source es) )
    9090            (else
    91               (error-argument-type
    92                 'make-entropy-source es
    93                 "valid entropy-source or registered entropy-source name") ) ) ) )
     91              #f ) ) ) )
     92    (unless ctor
     93      (error-argument-type
     94        'make-entropy-source es
     95        "valid entropy-source or registered entropy-source name") )
    9496    (ctor) ) )
    9597
     
    173175              (registered-random-source rs) )
    174176            (else
    175               (error-argument-type
    176                 'make-random-source rs
    177                 "valid random-source or registered random-source name") ) ) ) )
     177              #f ) ) ) )
     178    (unless ctor
     179      (error-argument-type
     180        'make-random-source rs
     181        "valid random-source or registered random-source name") )
    178182    (ctor) ) )
    179183
  • release/4/srfi-27/tags/3.2.4/srfi-27.setup

    r34015 r34017  
    77;; Utility Modules
    88
    9 (setup-shared-extension-module 'fp-extn (extension-version "3.2.3")
     9(setup-shared-extension-module 'fp-extn (extension-version "3.2.4")
    1010  #:inline? #t
    1111  #:types? #t
     
    1414    -no-procedure-checks -no-argc-checks -no-bound-checks) )
    1515
    16 (setup-shared-extension-module 'source-registration (extension-version "3.2.3")
     16(setup-shared-extension-module 'source-registration (extension-version "3.2.4")
    1717  #:inline? #t
    1818  #:types? #t
     
    2121    -no-procedure-checks -no-argc-checks -no-bound-checks) )
    2222
    23 (setup-shared-extension-module 'srfi-27-numbers (extension-version "3.2.3")
     23(setup-shared-extension-module 'srfi-27-numbers (extension-version "3.2.4")
    2424  #:inline? #t
    2525  #:types? #t
     
    2828    -no-procedure-checks -no-argc-checks -no-bound-checks) )
    2929
    30 (setup-shared-extension-module 'srfi-27-vector-support (extension-version "3.2.3")
     30(setup-shared-extension-module 'srfi-27-vector-support (extension-version "3.2.4")
    3131  #:inline? #t
    3232  #:types? #t
     
    3737;; Entropy Source Modules
    3838
    39 (setup-shared-extension-module 'entropy-source (extension-version "3.2.3")
     39(setup-shared-extension-module 'entropy-source (extension-version "3.2.4")
    4040  #:inline? #t
    4141  #:types? #t
     
    4444    -no-procedure-checks -no-argc-checks -no-bound-checks) )
    4545
    46 (setup-shared-extension-module 'entropy-support (extension-version "3.2.3")
     46(setup-shared-extension-module 'entropy-support (extension-version "3.2.4")
    4747  #:inline? #t
    4848  #:types? #t
     
    5151    -no-procedure-checks -no-argc-checks -no-bound-checks) )
    5252
    53 (setup-shared-extension-module 'entropy-clock (extension-version "3.2.3")
     53(setup-shared-extension-module 'entropy-clock (extension-version "3.2.4")
    5454  #:inline? #t
    5555  #:types? #t
     
    5858    -no-procedure-checks) )
    5959
    60 (setup-shared-extension-module 'entropy-procedure (extension-version "3.2.3")
     60(setup-shared-extension-module 'entropy-procedure (extension-version "3.2.4")
    6161  #:inline? #t
    6262  #:types? #t
     
    6565    -no-procedure-checks) )
    6666
    67 (setup-shared-extension-module 'entropy-port (extension-version "3.2.3")
     67(setup-shared-extension-module 'entropy-port (extension-version "3.2.4")
    6868  #:inline? #t
    6969  #:types? #t
     
    7373
    7474#+unix
    75 (setup-shared-extension-module 'entropy-unix (extension-version "3.2.3")
     75(setup-shared-extension-module 'entropy-unix (extension-version "3.2.4")
    7676  #:inline? #t
    7777  #:types? #t
     
    8181
    8282#+windows
    83 (setup-shared-extension-module 'entropy-windows (extension-version "3.2.3")
     83(setup-shared-extension-module 'entropy-windows (extension-version "3.2.4")
    8484  #:inline? #t
    8585  #:types? #t
     
    9090;; Random Source Modules
    9191
    92 (setup-shared-extension-module 'random-source (extension-version "3.2.3")
     92(setup-shared-extension-module 'random-source (extension-version "3.2.4")
    9393  #:inline? #t
    9494  #:types? #t
     
    9797    -no-procedure-checks -no-argc-checks -no-bound-checks) )
    9898
    99 (setup-shared-extension-module 'mrg32k3a (extension-version "3.2.3")
     99#;(setup-shared-extension-module 'bsdrnd (extension-version "3.2.4")
     100  #:inline? #t
     101  #:types? #t
     102  #:compile-options '(
     103    -scrutinize -optimize-level 3 -debug-level 0
     104    -no-procedure-checks -no-argc-checks -no-bound-checks ) )
     105
     106(setup-shared-extension-module 'mrg32k3a (extension-version "3.2.4")
    100107  #:inline? #t
    101108  #:types? #t
     
    105112    -no-procedure-checks -no-argc-checks -no-bound-checks) )
    106113
    107 (setup-shared-extension-module 'mwc (extension-version "3.2.3")
     114(setup-shared-extension-module 'mwc (extension-version "3.2.4")
    108115  #:inline? #t
    109116  #:types? #t
     
    112119    -no-procedure-checks -no-argc-checks -no-bound-checks) )
    113120
    114 (setup-shared-extension-module 'moa (extension-version "3.2.3")
     121(setup-shared-extension-module 'moa (extension-version "3.2.4")
    115122  #:inline? #t
    116123  #:types? #t
     
    119126    -no-procedure-checks -no-argc-checks -no-bound-checks) )
    120127
    121 (setup-shared-extension-module 'composite-random-source (extension-version "3.2.3")
     128(setup-shared-extension-module 'composite-random-source (extension-version "3.2.4")
    122129  #:inline? #t
    123130  #:types? #t
     
    128135;; Main Modules
    129136
    130 (setup-shared-extension-module 'srfi-27 (extension-version "3.2.3")
     137(setup-shared-extension-module 'srfi-27 (extension-version "3.2.4")
    131138  #:inline? #t
    132139  #:types? #t
     
    135142    -no-procedure-checks) )
    136143
    137 (setup-shared-extension-module 'srfi-27-uniform-random (extension-version "3.2.3")
     144(setup-shared-extension-module 'srfi-27-uniform-random (extension-version "3.2.4")
    138145  #:inline? #t
    139146  #:types? #t
     
    142149    #;-no-procedure-checks) )
    143150
    144 (setup-shared-extension-module 'srfi-27-distributions (extension-version "3.2.3")
     151(setup-shared-extension-module 'srfi-27-distributions (extension-version "3.2.4")
    145152  #:inline? #t
    146153  #:types? #t
     
    149156    -no-procedure-checks) )
    150157
    151 (setup-shared-extension-module 'srfi-27-vector (extension-version "3.2.3")
     158(setup-shared-extension-module 'srfi-27-vector (extension-version "3.2.4")
    152159  #:inline? #t
    153160  #:types? #t
  • release/4/srfi-27/tags/3.2.4/tests/run.scm

    r34015 r34017  
    1111
    1212(test-begin "SRFI 27")
     13
     14#|
     15(use bsdrnd)
     16(make-random-source 'bsd)
     17|#
    1318
    1419;;
  • release/4/srfi-27/tags/3.2.4/tests/test-confidence.scm

    r34011 r34017  
    44(use srfi-27)
    55(use random-source)
    6 (use mwc moa mrg32k3a)  ; load them all
     6(use mwc moa mrg32k3a #;bsdrnd)  ; load them all
    77
    88;; Select platform specific entropy source
     
    122122
    123123  ; get/set the state
    124   (display "get/set state: ") (flush-output)
    125   (let* ((state1 (random-source-state-ref (current-random-source)))
    126          (x1 (checked-random-integer (expt 2 32)))
    127          (state2 (random-source-state-ref (current-random-source)))
    128          (x2 (checked-random-integer (expt 2 32))))
    129     (random-source-state-set! (current-random-source) state1)
    130     (let ((y1 (checked-random-integer (expt 2 32))))
    131       (unless (= x1 y1)
    132         (error 'check-basics "state 1 get/set doesn't work" x1 y1 state1)))
    133     (random-source-state-set! (current-random-source) state2)
    134     (let ((y2 (checked-random-integer (expt 2 32))))
    135       (unless (= x2 y2)
    136         (error 'check-basics "state 2 get/set doesn't work" x2 y2 state2))))
    137   (print "ok")
     124  (if (not (random-source-state-ref (current-random-source)))
     125    (warning 'check-basics "lacks state support")
     126    (begin
     127      (display "get/set state: ") (flush-output)
     128      (let* ((state1 (random-source-state-ref (current-random-source)))
     129             (x1 (checked-random-integer (expt 2 32)))
     130             (state2 (random-source-state-ref (current-random-source)))
     131             (x2 (checked-random-integer (expt 2 32))))
     132        (random-source-state-set! (current-random-source) state1)
     133        (let ((y1 (checked-random-integer (expt 2 32))))
     134          (unless (= x1 y1)
     135            (error 'check-basics "state 1 get/set doesn't work" x1 y1 state1)))
     136        (random-source-state-set! (current-random-source) state2)
     137        (let ((y2 (checked-random-integer (expt 2 32))))
     138          (unless (= x2 y2)
     139            (error 'check-basics "state 2 get/set doesn't work" x2 y2 state2))))
     140      (print "ok") ) )
    138141
    139142  ; randomize!
  • release/4/srfi-27/trunk/source-registration.scm

    r34015 r34017  
    4343
    4444(define (make-source-registration name sources)
    45   (letrec ((reg
    46             (*make-source-registration
    47               (check-symbol 'make-source-registration name "name")
    48               (check-list 'make-source-registration sources "sources")
    49               (lambda ()
    50                 (alist-keys (*source-registration-sources reg)) )
    51               (lambda (name)
    52                 (alist-ref
    53                   (check-symbol 'source-registration-ref name)
    54                   (*source-registration-sources reg)
    55                   eq? #f) )
    56               (lambda (name)
    57                 (*source-registration-sources-set!
    58                   reg
    59                   (alist-delete!
    60                     (check-symbol 'source-registration-deref! name)
    61                     (*source-registration-sources reg)
    62                     eq?)) )
    63               (lambda (name ctor)
    64                 (*source-registration-sources-set!
    65                   reg
    66                   (alist-update!
    67                     (check-symbol 'source-registration-register!! name)
    68                     (check-procedure 'source-registration-register! ctor)
    69                     (*source-registration-sources reg)
    70                     eq?)))) ) )
     45  (letrec (
     46      (reg
     47        (*make-source-registration
     48          ;
     49          (check-symbol 'make-source-registration name "name")
     50          ;
     51          (check-list 'make-source-registration sources "sources")
     52          ;
     53          (lambda ()
     54            (alist-keys (*source-registration-sources reg)) )
     55          ;
     56          (lambda (name)
     57            (alist-ref
     58              (check-symbol 'source-registration-ref name)
     59              (*source-registration-sources reg)
     60              eq?
     61              #f) )
     62          ;
     63          (lambda (name)
     64            (*source-registration-sources-set!
     65              reg
     66              (alist-delete!
     67                (check-symbol 'source-registration-deref! name)
     68                (*source-registration-sources reg)
     69                eq?)) )
     70          ;
     71          (lambda (name ctor)
     72            (*source-registration-sources-set!
     73              reg
     74              (alist-update!
     75                (check-symbol 'source-registration-register!! name)
     76                (check-procedure 'source-registration-register! ctor)
     77                (*source-registration-sources reg)
     78                eq?)))) ) )
    7179    reg ) )
    7280
  • release/4/srfi-27/trunk/srfi-27.meta

    r34015 r34017  
    1515        (vector-lib "1.2")
    1616        (numbers "2.8")
    17         (synch "2.1.0"))
     17        (synch "2.1.0")
     18        #;(random-bsd "0.2"))
    1819 (files "mrg32k3a.scm" "srfi-27.meta" "srfi-27-uniform-random.scm" "mwc.scm"
    1920 "srfi-27.setup" "entropy-procedure.scm" "srfi-27.release-info"
     
    2324 "srfi-27-distributions.scm" "srfi-27-vector.scm" "srfi-27.scm"
    2425 "entropy-windows.scm" "moa.scm" "entropy-support.scm"
     26 #;"bsdrnd.scm"
    2527 "source-registration.scm" "tests/test-diehard.scm" "tests/test-confidence.scm"
    2628 "tests/test-mrg32k3a.scm" "tests/run.scm" "entropy-port.scm") )
  • release/4/srfi-27/trunk/srfi-27.scm

    r34015 r34017  
    8989              (registered-entropy-source es) )
    9090            (else
    91               (error-argument-type
    92                 'make-entropy-source es
    93                 "valid entropy-source or registered entropy-source name") ) ) ) )
     91              #f ) ) ) )
     92    (unless ctor
     93      (error-argument-type
     94        'make-entropy-source es
     95        "valid entropy-source or registered entropy-source name") )
    9496    (ctor) ) )
    9597
     
    173175              (registered-random-source rs) )
    174176            (else
    175               (error-argument-type
    176                 'make-random-source rs
    177                 "valid random-source or registered random-source name") ) ) ) )
     177              #f ) ) ) )
     178    (unless ctor
     179      (error-argument-type
     180        'make-random-source rs
     181        "valid random-source or registered random-source name") )
    178182    (ctor) ) )
    179183
  • release/4/srfi-27/trunk/srfi-27.setup

    r34015 r34017  
    77;; Utility Modules
    88
    9 (setup-shared-extension-module 'fp-extn (extension-version "3.2.3")
     9(setup-shared-extension-module 'fp-extn (extension-version "3.2.4")
    1010  #:inline? #t
    1111  #:types? #t
     
    1414    -no-procedure-checks -no-argc-checks -no-bound-checks) )
    1515
    16 (setup-shared-extension-module 'source-registration (extension-version "3.2.3")
     16(setup-shared-extension-module 'source-registration (extension-version "3.2.4")
    1717  #:inline? #t
    1818  #:types? #t
     
    2121    -no-procedure-checks -no-argc-checks -no-bound-checks) )
    2222
    23 (setup-shared-extension-module 'srfi-27-numbers (extension-version "3.2.3")
     23(setup-shared-extension-module 'srfi-27-numbers (extension-version "3.2.4")
    2424  #:inline? #t
    2525  #:types? #t
     
    2828    -no-procedure-checks -no-argc-checks -no-bound-checks) )
    2929
    30 (setup-shared-extension-module 'srfi-27-vector-support (extension-version "3.2.3")
     30(setup-shared-extension-module 'srfi-27-vector-support (extension-version "3.2.4")
    3131  #:inline? #t
    3232  #:types? #t
     
    3737;; Entropy Source Modules
    3838
    39 (setup-shared-extension-module 'entropy-source (extension-version "3.2.3")
     39(setup-shared-extension-module 'entropy-source (extension-version "3.2.4")
    4040  #:inline? #t
    4141  #:types? #t
     
    4444    -no-procedure-checks -no-argc-checks -no-bound-checks) )
    4545
    46 (setup-shared-extension-module 'entropy-support (extension-version "3.2.3")
     46(setup-shared-extension-module 'entropy-support (extension-version "3.2.4")
    4747  #:inline? #t
    4848  #:types? #t
     
    5151    -no-procedure-checks -no-argc-checks -no-bound-checks) )
    5252
    53 (setup-shared-extension-module 'entropy-clock (extension-version "3.2.3")
     53(setup-shared-extension-module 'entropy-clock (extension-version "3.2.4")
    5454  #:inline? #t
    5555  #:types? #t
     
    5858    -no-procedure-checks) )
    5959
    60 (setup-shared-extension-module 'entropy-procedure (extension-version "3.2.3")
     60(setup-shared-extension-module 'entropy-procedure (extension-version "3.2.4")
    6161  #:inline? #t
    6262  #:types? #t
     
    6565    -no-procedure-checks) )
    6666
    67 (setup-shared-extension-module 'entropy-port (extension-version "3.2.3")
     67(setup-shared-extension-module 'entropy-port (extension-version "3.2.4")
    6868  #:inline? #t
    6969  #:types? #t
     
    7373
    7474#+unix
    75 (setup-shared-extension-module 'entropy-unix (extension-version "3.2.3")
     75(setup-shared-extension-module 'entropy-unix (extension-version "3.2.4")
    7676  #:inline? #t
    7777  #:types? #t
     
    8181
    8282#+windows
    83 (setup-shared-extension-module 'entropy-windows (extension-version "3.2.3")
     83(setup-shared-extension-module 'entropy-windows (extension-version "3.2.4")
    8484  #:inline? #t
    8585  #:types? #t
     
    9090;; Random Source Modules
    9191
    92 (setup-shared-extension-module 'random-source (extension-version "3.2.3")
     92(setup-shared-extension-module 'random-source (extension-version "3.2.4")
    9393  #:inline? #t
    9494  #:types? #t
     
    9797    -no-procedure-checks -no-argc-checks -no-bound-checks) )
    9898
    99 (setup-shared-extension-module 'mrg32k3a (extension-version "3.2.3")
     99#;(setup-shared-extension-module 'bsdrnd (extension-version "3.2.4")
     100  #:inline? #t
     101  #:types? #t
     102  #:compile-options '(
     103    -scrutinize -optimize-level 3 -debug-level 0
     104    -no-procedure-checks -no-argc-checks -no-bound-checks ) )
     105
     106(setup-shared-extension-module 'mrg32k3a (extension-version "3.2.4")
    100107  #:inline? #t
    101108  #:types? #t
     
    105112    -no-procedure-checks -no-argc-checks -no-bound-checks) )
    106113
    107 (setup-shared-extension-module 'mwc (extension-version "3.2.3")
     114(setup-shared-extension-module 'mwc (extension-version "3.2.4")
    108115  #:inline? #t
    109116  #:types? #t
     
    112119    -no-procedure-checks -no-argc-checks -no-bound-checks) )
    113120
    114 (setup-shared-extension-module 'moa (extension-version "3.2.3")
     121(setup-shared-extension-module 'moa (extension-version "3.2.4")
    115122  #:inline? #t
    116123  #:types? #t
     
    119126    -no-procedure-checks -no-argc-checks -no-bound-checks) )
    120127
    121 (setup-shared-extension-module 'composite-random-source (extension-version "3.2.3")
     128(setup-shared-extension-module 'composite-random-source (extension-version "3.2.4")
    122129  #:inline? #t
    123130  #:types? #t
     
    128135;; Main Modules
    129136
    130 (setup-shared-extension-module 'srfi-27 (extension-version "3.2.3")
     137(setup-shared-extension-module 'srfi-27 (extension-version "3.2.4")
    131138  #:inline? #t
    132139  #:types? #t
     
    135142    -no-procedure-checks) )
    136143
    137 (setup-shared-extension-module 'srfi-27-uniform-random (extension-version "3.2.3")
     144(setup-shared-extension-module 'srfi-27-uniform-random (extension-version "3.2.4")
    138145  #:inline? #t
    139146  #:types? #t
     
    142149    #;-no-procedure-checks) )
    143150
    144 (setup-shared-extension-module 'srfi-27-distributions (extension-version "3.2.3")
     151(setup-shared-extension-module 'srfi-27-distributions (extension-version "3.2.4")
    145152  #:inline? #t
    146153  #:types? #t
     
    149156    -no-procedure-checks) )
    150157
    151 (setup-shared-extension-module 'srfi-27-vector (extension-version "3.2.3")
     158(setup-shared-extension-module 'srfi-27-vector (extension-version "3.2.4")
    152159  #:inline? #t
    153160  #:types? #t
  • release/4/srfi-27/trunk/tests/run.scm

    r34015 r34017  
    1111
    1212(test-begin "SRFI 27")
     13
     14#|
     15(use bsdrnd)
     16(make-random-source 'bsd)
     17|#
    1318
    1419;;
  • release/4/srfi-27/trunk/tests/test-confidence.scm

    r34011 r34017  
    44(use srfi-27)
    55(use random-source)
    6 (use mwc moa mrg32k3a)  ; load them all
     6(use mwc moa mrg32k3a #;bsdrnd)  ; load them all
    77
    88;; Select platform specific entropy source
     
    122122
    123123  ; get/set the state
    124   (display "get/set state: ") (flush-output)
    125   (let* ((state1 (random-source-state-ref (current-random-source)))
    126          (x1 (checked-random-integer (expt 2 32)))
    127          (state2 (random-source-state-ref (current-random-source)))
    128          (x2 (checked-random-integer (expt 2 32))))
    129     (random-source-state-set! (current-random-source) state1)
    130     (let ((y1 (checked-random-integer (expt 2 32))))
    131       (unless (= x1 y1)
    132         (error 'check-basics "state 1 get/set doesn't work" x1 y1 state1)))
    133     (random-source-state-set! (current-random-source) state2)
    134     (let ((y2 (checked-random-integer (expt 2 32))))
    135       (unless (= x2 y2)
    136         (error 'check-basics "state 2 get/set doesn't work" x2 y2 state2))))
    137   (print "ok")
     124  (if (not (random-source-state-ref (current-random-source)))
     125    (warning 'check-basics "lacks state support")
     126    (begin
     127      (display "get/set state: ") (flush-output)
     128      (let* ((state1 (random-source-state-ref (current-random-source)))
     129             (x1 (checked-random-integer (expt 2 32)))
     130             (state2 (random-source-state-ref (current-random-source)))
     131             (x2 (checked-random-integer (expt 2 32))))
     132        (random-source-state-set! (current-random-source) state1)
     133        (let ((y1 (checked-random-integer (expt 2 32))))
     134          (unless (= x1 y1)
     135            (error 'check-basics "state 1 get/set doesn't work" x1 y1 state1)))
     136        (random-source-state-set! (current-random-source) state2)
     137        (let ((y2 (checked-random-integer (expt 2 32))))
     138          (unless (= x2 y2)
     139            (error 'check-basics "state 2 get/set doesn't work" x2 y2 state2))))
     140      (print "ok") ) )
    138141
    139142  ; randomize!
Note: See TracChangeset for help on using the changeset viewer.