aboutsummaryrefslogtreecommitdiff
path: root/guile/starlet/base.scm
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-01-31 16:27:30 +0100
committerThomas White <taw@physics.org>2021-01-31 16:27:30 +0100
commitb960ac6f3bca42901694cd76218796108e0127a8 (patch)
treee2d889d2531dbc6c79c7ca78d0c275356511de9b /guile/starlet/base.scm
parentd84543e948e7faacd6e4e55b3583b88289ec9147 (diff)
Initial part of writing out states
Diffstat (limited to 'guile/starlet/base.scm')
-rw-r--r--guile/starlet/base.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/guile/starlet/base.scm b/guile/starlet/base.scm
index f0424af..efb2c64 100644
--- a/guile/starlet/base.scm
+++ b/guile/starlet/base.scm
@@ -22,6 +22,7 @@
scale-to-range
hirestime
state-for-each
+ state-map
get-attributes
set-attr!
get-attr-name
@@ -48,6 +49,7 @@
find-attr
fixture?
fixture-attribute?
+ get-fixture-name
selection-hook
sel
programmer-state
@@ -268,6 +270,13 @@
(hash-ref (get-state-hash-table state)
(cons fix attr)))
+(define (state-map func state)
+ (hash-map->list (lambda (key value)
+ (func (car key)
+ (cdr key)
+ value))
+ (get-state-hash-table state)))
+
;; Add the contents of state "new" to "combined-state"
(define (add-state-to-state! merge-rule new combined-state)