diff options
author | Thomas White <taw@physics.org> | 2021-05-20 20:59:24 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-05-22 11:58:53 +0200 |
commit | 84a2c09c909b2dd249873d199cc9ea83e59f60fe (patch) | |
tree | 48c156614d4e3e1f9cd4335bf8c0b19b69d2dfa8 /guile/starlet | |
parent | 0c7c05b20256d5cf31ac829c788326bbaef5c2ec (diff) |
Add total-num-attrs
Diffstat (limited to 'guile/starlet')
-rw-r--r-- | guile/starlet/scanout.scm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/guile/starlet/scanout.scm b/guile/starlet/scanout.scm index c5b95aa..70698d4 100644 --- a/guile/starlet/scanout.scm +++ b/guile/starlet/scanout.scm @@ -31,6 +31,7 @@ #:use-module (srfi srfi-1) #:export (patch-fixture! scanout-freq + total-num-attrs register-state! current-value)) @@ -45,6 +46,13 @@ (define state-names (make-atomic-box '())) +(define (total-num-attrs) + (fold (lambda (fix prev) + (+ prev (length (get-fixture-attrs fix)))) + 0 + (atomic-box-ref fixtures))) + + (define (get-state-name st) (assq-ref (atomic-box-ref state-names) st)) |