Changeset 39349 in project


Ignore:
Timestamp:
11/23/20 17:13:54 (5 months ago)
Author:
Kon Lovett
Message:

rename stats-set ref func

Location:
release/5/micro-stats/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/5/micro-stats/trunk/micro-stats.scm

    r39348 r39349  
    88
    99(;export
    10   statistics-sets current-statistics-set
     10  statistics-sets statistics-set
    1111  basic-statistics
    1212  generate-statistics generate-statistics-alist
     
    3838(define-type statistics-alist (or null (list-of (pair symbol *))))
    3939
     40(define-type statistics-set-id (or symbol boolean))
     41
    4042(: statistics-sets (#!optional alist -> alist))
    41 (: current-statistics-set ((or symbol boolean) --> (or boolean statistics-alist)))
     43(: statistics-set (statistics-set-id -> alist))
    4244(: basic-statistics (seq --> (vector-of real)))
    4345(: generate-statistics (seq #!optional (or symbol boolean) --> (or boolean statistics-alist)))
     
    145147(define-checked-parameter statistics-sets INITIAL-STATISTICS-SETS alist)
    146148
    147 (define (current-statistics-set stat-set-id)
     149(define (statistics-set stat-set-id)
    148150  (and-let* (
    149151    (stat-set-id
     
    153155        (else
    154156          (if (symbol? stat-set-id) stat-set-id
    155             (error 'current-statistics-set "not a valid stat-set-id" stat-set-id))))) )
     157            (error 'statistics-set "not a valid stat-set-id" stat-set-id))))) )
    156158     (alist-ref stat-set-id (statistics-sets) eq?) ) )
    157159
     
    178180  (let (
    179181    (basics (basic-statistics runs))
    180     (funcs (current-statistics-set stat-set-id)) )
     182    (funcs (statistics-set stat-set-id)) )
    181183    (generate-statistics-alist runs funcs basics) ) )
    182184
  • release/5/micro-stats/trunk/tests/micro-stats-test.scm

    r39348 r39349  
    1414  (test-assert (list? (alist-ref 'normal (statistics-sets) eq?)))
    1515  (test-assert (list? (alist-ref 'verbose (statistics-sets) eq?)))
    16   (test (alist-ref 'normal (statistics-sets) eq?) (current-statistics-set #f))
    17   (test (alist-ref 'verbose (statistics-sets) eq?) (current-statistics-set #t))
     16  (test (alist-ref 'normal (statistics-sets) eq?) (statistics-set #f))
     17  (test (alist-ref 'verbose (statistics-sets) eq?) (statistics-set #t))
    1818)
    1919
Note: See TracChangeset for help on using the changeset viewer.