Changeset 35514 in project


Ignore:
Timestamp:
05/01/18 17:08:33 (6 months ago)
Author:
kon
Message:

fix composite type, rename composite ctor-ctor (no one uses these, right?)

Location:
release/4/srfi-27
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • release/4/srfi-27/OO-example.scm

    r34969 r35514  
    6767          (and-let* ((kndpos (string-index-right procname #\-)))
    6868            (substring/shared procname (add1 kndpos)) ) ) )
     69      (procname (or procname "impossible"))
    6970      (dstr-vals
    7071        (receive (apply ctor (cdr tmpval))) )
  • release/4/srfi-27/trunk/composite-entropy-source.scm

    r35490 r35514  
    1313==== composite-entropy-source
    1414
    15 <procedure>(composite-entropy-source [ENTROPY-SOURCE ...] [#:comb-int (COMB-INT INTEGER-COMBINE)] [#:comb-real (COMB-REAL REAL-COMBINE)]) => entropy-source</procedure>
     15<procedure>(composite-entropy-source-constructor [ENTROPY-SOURCE ...] [#:comb-int (COMB-INT INTEGER-COMBINE)] [#:comb-real (COMB-REAL REAL-COMBINE)]) => entropy-source</procedure>
    1616
    1717Returns a new {{entropy-source}} that combines the behaviors of the supplied
     
    3030
    3131(;export
    32   *composite-entropy-source
    33   composite-entropy-source)
     32  *composite-entropy-source-constructor
     33  composite-entropy-source-constructor)
    3434
    3535(import scheme chicken)
     
    6060        (loop (cdr irest) (cons (car irest) orest)) ) ) ) )
    6161
    62 ;; composite-entropy-source
     62;; composite-entropy-source-constructor
    6363;;
    6464;; returns the composite name & constructor
     
    6666;FIXME - the combinators are suspect
    6767
    68 (: composite-entropy-source (#!rest --> entropy-source))
     68(: composite-entropy-source-constructor (#!rest --> procedure))
    6969;
    70 (define (composite-entropy-source
     70(define (composite-entropy-source-constructor
    7171          #!rest rest0
    7272          #!key
     
    7878      (srcs0
    7979        (if (null? rest)
    80           (error 'composite-entropy-source "no entropy-sources to combine")
    81           (map (cut check-entropy-source 'composite-entropy-source <>) rest) ) ) )
     80          (error 'composite-entropy-source-constructor "no entropy-sources to combine")
     81          (map (cut check-entropy-source 'composite-entropy-source-constructor <>) rest) ) ) )
    8282    ;collect features
    8383    (let loop ((srcs srcs0) (names '()) (docus '()))
    8484      (if (null? srcs)
    8585        ;then make composed entropy-source
    86         (*composite-entropy-source
     86        (*composite-entropy-source-constructor
    8787          comb-int comb-real
    8888          (string->symbol (reverse-string-append (intersperse names "+")))
     
    9696            (cons (*entropy-source-documentation es) docus)) ) ) ) ) )
    9797
    98 ;; *composite-entropy-source
     98;; *composite-entropy-source-constructor
    9999;;
    100100;; returns the composite constructor
    101101
    102 (: *composite-entropy-source (procedure procedure entropy-source-name string (list-of entropy-source) --> entropy-source))
     102(: *composite-entropy-source-constructor (procedure procedure entropy-source-name string (list-of entropy-source) --> procedure))
    103103;
    104 (define (*composite-entropy-source comb-int comb-real def-name def-docu srcs)
     104(define (*composite-entropy-source-constructor comb-int comb-real def-name def-docu srcs)
    105105  (let (
    106106      (u8proc
  • release/4/srfi-27/trunk/composite-random-source.scm

    r35490 r35514  
    1111</enscript>
    1212
    13 ==== composite-random-source
    14 
    15 <procedure>(composite-random-source [RANDOM-SOURCE ...] [#:comb-int (COMB-INT INTEGER-COMBINE)] [#:comb-real (COMB-REAL REAL-COMBINE)]) => random-source</procedure>
     13==== composite-random-source-constructor
     14
     15<procedure>(composite-random-source-constructor [RANDOM-SOURCE ...] [#:comb-int (COMB-INT INTEGER-COMBINE)] [#:comb-real (COMB-REAL REAL-COMBINE)]) => random-source</procedure>
    1616
    1717Returns a new {{random-source}} that combines the behaviors of the supplied
     
    3030
    3131(;export
    32   *composite-random-source
    33   composite-random-source
     32  *composite-random-source-constructor
     33  composite-random-source-constructor
    3434  make-composite-random-state-predicate
    3535  composite-random-state?
     
    6565        (loop (cdr irest) (cons (car irest) orest)) ) ) ) )
    6666
    67 ;; composite-random-source
     67;; composite-random-source-constructor
    6868;;
    6969;; returns the composite name & constructor
     
    7878;FIXME - the combinators are suspect
    7979
    80 (: composite-random-source (#!rest --> random-source))
    81 ;
    82 (define (composite-random-source
     80(: composite-random-source-constructor (#!rest --> procedure))
     81;
     82(define (composite-random-source-constructor
    8383          #!rest rest0
    8484          #!key
     
    9090      (srcs0
    9191        (if (null? rest)
    92           (error 'composite-random-source "empty random-sources")
    93           (map (cut check-random-source 'composite-random-source <>) rest) ) ) )
     92          (error 'composite-random-source-constructor "empty random-sources")
     93          (map (cut check-random-source 'composite-random-source-constructor <>) rest) ) ) )
    9494    ;collect features
    9595    (let loop ((srcs srcs0) (names '()) (docus '()) (log2-periods '()) (maxrngs '()))
    9696      (if (null? srcs)
    9797        ;then make composed random-source
    98         (*composite-random-source
     98        (*composite-random-source-constructor
    9999          comb-int comb-real
    100100          (string->symbol (reverse-string-append (intersperse names "+")))
     
    114114            (cons (*random-source-maximum-range rs) maxrngs)) ) ) ) ) )
    115115
    116 ;; *composite-random-source
     116;; *composite-random-source-constructor
    117117;;
    118118;; returns the composite constructor
    119119
    120 (: *composite-random-source (procedure procedure random-source-name string number number (list-of random-source) --> random-source))
    121 ;
    122 (define (*composite-random-source comb-int comb-real def-name def-docu log2-period maxrng srcs)
     120(: *composite-random-source-constructor (procedure procedure random-source-name string number number (list-of random-source) --> procedure))
     121;
     122(define (*composite-random-source-constructor comb-int comb-real def-name def-docu log2-period maxrng srcs)
    123123  (let (
    124124    (srcs-cnt (length srcs))
     
    167167      ctor ) ) )
    168168
     169;;
     170
    169171(: make-composite-random-state-predicate (random-source-name #!optional (or fixnum (list-of random-source)) --> procedure))
    170172;
  • release/4/srfi-27/trunk/srfi-27.setup

    r35490 r35514  
    1717  -no-procedure-checks-for-toplevel-bindings))
    1818
    19 (setup-shared-extension-module 'source-registration (extension-version "3.4.0")
     19(setup-shared-extension-module 'source-registration (extension-version "3.4.1")
    2020  #:inline? #t #:types? #t #:compile-options UTILITY-OPTIONS)
    2121
    22 (setup-shared-extension-module 'srfi-27-numbers (extension-version "3.4.0")
     22(setup-shared-extension-module 'srfi-27-numbers (extension-version "3.4.1")
    2323  #:inline? #t #:types? #t #:compile-options UTILITY-OPTIONS)
    2424
    25 (setup-shared-extension-module 'srfi-27-vector-support (extension-version "3.4.0")
     25(setup-shared-extension-module 'srfi-27-vector-support (extension-version "3.4.1")
    2626  #:inline? #t #:types? #t #:compile-options UTILITY-OPTIONS)
    2727
    2828;; Entropy Source Modules
    2929
    30 (setup-shared-extension-module 'entropy-source (extension-version "3.4.0")
     30(setup-shared-extension-module 'entropy-source (extension-version "3.4.1")
    3131  #:inline? #t #:types? #t #:compile-options UTILITY-OPTIONS)
    3232
    33 (setup-shared-extension-module 'entropy-support (extension-version "3.4.0")
     33(setup-shared-extension-module 'entropy-support (extension-version "3.4.1")
    3434  #:inline? #t #:types? #t #:compile-options UTILITY-OPTIONS)
    3535
    36 (setup-shared-extension-module 'entropy-clock (extension-version "3.4.0")
     36(setup-shared-extension-module 'entropy-clock (extension-version "3.4.1")
    3737  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    3838
    39 (setup-shared-extension-module 'entropy-procedure (extension-version "3.4.0")
     39(setup-shared-extension-module 'entropy-procedure (extension-version "3.4.1")
    4040  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    4141
    42 (setup-shared-extension-module 'entropy-port (extension-version "3.4.0")
     42(setup-shared-extension-module 'entropy-port (extension-version "3.4.1")
    4343  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    4444
    4545#+unix
    46 (setup-shared-extension-module 'entropy-unix (extension-version "3.4.0")
     46(setup-shared-extension-module 'entropy-unix (extension-version "3.4.1")
    4747  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    4848
    4949#|
    5050#+linux
    51 (setup-shared-extension-module 'entropy-linux (extension-version "3.4.0")
     51(setup-shared-extension-module 'entropy-linux (extension-version "3.4.1")
    5252  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    5353|#
    5454
    5555#+windows
    56 (setup-shared-extension-module 'entropy-windows (extension-version "3.4.0")
     56(setup-shared-extension-module 'entropy-windows (extension-version "3.4.1")
    5757  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    5858
     
    6060
    6161#; ;WIP
    62 (setup-shared-extension-module 'well512 (extension-version "3.4.0")
     62(setup-shared-extension-module 'well512 (extension-version "3.4.1")
    6363  #:inline? #t #:types? #t #:compile-options UTILITY-OPTIONS)
    6464
    65 (setup-shared-extension-module 'random-source (extension-version "3.4.0")
     65(setup-shared-extension-module 'random-source (extension-version "3.4.1")
    6666  #:inline? #t #:types? #t #:compile-options UTILITY-OPTIONS)
    6767
    6868;-c++ w/ crunch
    69 (setup-shared-extension-module 'mrg32k3a (extension-version "3.4.0")
     69(setup-shared-extension-module 'mrg32k3a (extension-version "3.4.1")
    7070  #:inline? #t #:types? #t #:compile-options UTILITY-OPTIONS)
    7171
    72 (setup-shared-extension-module 'mwc (extension-version "3.4.0")
     72(setup-shared-extension-module 'mwc (extension-version "3.4.1")
    7373  #:inline? #t #:types? #t #:compile-options UTILITY-OPTIONS)
    7474
    75 (setup-shared-extension-module 'moa (extension-version "3.4.0")
     75(setup-shared-extension-module 'moa (extension-version "3.4.1")
    7676  #:inline? #t #:types? #t #:compile-options UTILITY-OPTIONS)
    7777
    7878#;
    79 (setup-shared-extension-module 'bsdrnd (extension-version "3.4.0")
     79(setup-shared-extension-module 'bsdrnd (extension-version "3.4.1")
    8080  #:inline? #t #:types? #t #:compile-options UTILITY-OPTIONS)
    8181
    8282;; Main Modules
    8383
    84 (setup-shared-extension-module 'srfi-27 (extension-version "3.4.0")
     84(setup-shared-extension-module 'srfi-27 (extension-version "3.4.1")
    8585  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    8686
    87 (setup-shared-extension-module 'srfi-27-uniform-random (extension-version "3.4.0")
     87(setup-shared-extension-module 'srfi-27-uniform-random (extension-version "3.4.1")
    8888  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    8989
    90 (setup-shared-extension-module 'srfi-27-distributions-support (extension-version "3.4.0")
     90(setup-shared-extension-module 'srfi-27-distributions-support (extension-version "3.4.1")
    9191  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    9292
    93 (setup-shared-extension-module 'srfi-27-bernoullis (extension-version "3.4.0")
     93(setup-shared-extension-module 'srfi-27-bernoullis (extension-version "3.4.1")
    9494  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    9595
    96 (setup-shared-extension-module 'srfi-27-binomials (extension-version "3.4.0")
     96(setup-shared-extension-module 'srfi-27-binomials (extension-version "3.4.1")
    9797  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    9898
    99 (setup-shared-extension-module 'srfi-27-cauchys (extension-version "3.4.0")
     99(setup-shared-extension-module 'srfi-27-cauchys (extension-version "3.4.1")
    100100  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    101101
    102 (setup-shared-extension-module 'srfi-27-normals (extension-version "3.4.0")
     102(setup-shared-extension-module 'srfi-27-normals (extension-version "3.4.1")
    103103  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    104104
    105105;needs normals
    106 (setup-shared-extension-module 'srfi-27-gammas (extension-version "3.4.0")
     106(setup-shared-extension-module 'srfi-27-gammas (extension-version "3.4.1")
    107107  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    108108
    109109;needs gammas
    110 (setup-shared-extension-module 'srfi-27-erlangs (extension-version "3.4.0")
     110(setup-shared-extension-module 'srfi-27-erlangs (extension-version "3.4.1")
    111111  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    112112
    113 (setup-shared-extension-module 'srfi-27-exponentials (extension-version "3.4.0")
     113(setup-shared-extension-module 'srfi-27-exponentials (extension-version "3.4.1")
    114114  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    115115
    116 (setup-shared-extension-module 'srfi-27-geometrics (extension-version "3.4.0")
     116(setup-shared-extension-module 'srfi-27-geometrics (extension-version "3.4.1")
    117117  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    118118
    119 (setup-shared-extension-module 'srfi-27-levys (extension-version "3.4.0")
     119(setup-shared-extension-module 'srfi-27-levys (extension-version "3.4.1")
    120120  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    121121
    122 (setup-shared-extension-module 'srfi-27-lognormals (extension-version "3.4.0")
     122(setup-shared-extension-module 'srfi-27-lognormals (extension-version "3.4.1")
    123123  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    124124
    125125;needs gammas exponentials
    126 (setup-shared-extension-module 'srfi-27-paretos (extension-version "3.4.0")
     126(setup-shared-extension-module 'srfi-27-paretos (extension-version "3.4.1")
    127127  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    128128
    129 (setup-shared-extension-module 'srfi-27-poissons (extension-version "3.4.0")
     129(setup-shared-extension-module 'srfi-27-poissons (extension-version "3.4.1")
    130130  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    131131
    132 (setup-shared-extension-module 'srfi-27-triangles (extension-version "3.4.0")
     132(setup-shared-extension-module 'srfi-27-triangles (extension-version "3.4.1")
    133133  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    134134
    135 (setup-shared-extension-module 'srfi-27-weibulls (extension-version "3.4.0")
     135(setup-shared-extension-module 'srfi-27-weibulls (extension-version "3.4.1")
    136136  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    137137
    138 (setup-shared-extension-module 'srfi-27-distributions (extension-version "3.4.0")
     138(setup-shared-extension-module 'srfi-27-distributions (extension-version "3.4.1")
    139139  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    140140
    141 (setup-shared-extension-module 'srfi-27-vector (extension-version "3.4.0")
     141(setup-shared-extension-module 'srfi-27-vector (extension-version "3.4.1")
    142142  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    143143
    144144;; Composite Source Modules
    145145
    146 (setup-shared-extension-module 'composite-entropy-source (extension-version "3.4.0")
     146(setup-shared-extension-module 'composite-entropy-source (extension-version "3.4.1")
    147147  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
    148148
    149 (setup-shared-extension-module 'composite-random-source (extension-version "3.4.0")
     149(setup-shared-extension-module 'composite-random-source (extension-version "3.4.1")
    150150  #:inline? #t #:types? #t #:compile-options PUBLIC-OPTIONS)
  • release/4/srfi-27/trunk/tests/srfi-27-test.scm

    r35473 r35514  
    185185; Composite Entropy (experimental - at best)
    186186
     187(use composite-entropy-source)
    187188(use entropy-clock)
    188 
    189 (use composite-entropy-source)
    190 
    191189(cond-expand
    192190  (windows
     
    207205(test-group COMPOSITE-ENTROPY-TITLE
    208206  (let* ((ces-ctor
    209           (composite-entropy-source
     207          (composite-entropy-source-constructor
    210208            (make-entropy-source-system-clock)
    211209            (cond-expand
     
    237235(test-group "composite random : mwc + mrg32k3a + moa"
    238236  (let* ((crs-ctor
    239           (composite-random-source
     237          (composite-random-source-constructor
    240238            (make-random-source-mwc)
    241239            (make-random-source-mrg32k3a)
Note: See TracChangeset for help on using the changeset viewer.