aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2023-04-11 22:18:00 +0200
committerThomas White <taw@physics.org>2023-04-11 22:18:00 +0200
commit997502be5b815f4c199395e92e75944411e0d005 (patch)
tree8d3eeaa9b04b0a2da609d86948a816439dfc1279
parent18e580dbc151691fd677dff7878e292d426c9b42 (diff)
Add an optional comment field to the fixture's attributes
-rw-r--r--guile/starlet/fixture.scm29
1 files changed, 27 insertions, 2 deletions
diff --git a/guile/starlet/fixture.scm b/guile/starlet/fixture.scm
index b1a3e32..9d210ff 100644
--- a/guile/starlet/fixture.scm
+++ b/guile/starlet/fixture.scm
@@ -65,7 +65,12 @@
(home-value
#:init-value 0
#:init-keyword #:home-value
- #:getter attr-home-value))
+ #:getter attr-home-value)
+
+ (comment
+ #:init-value ""
+ #:init-keyword #:comment
+ #:getter attr-comment))
(define-class <fixture> (<object>)
@@ -100,6 +105,13 @@
(define-syntax attr-continuous
(syntax-rules ()
+ ((_ attr-name attr-range attr-home-value comment)
+ (make <fixture-attribute>
+ #:name attr-name
+ #:range attr-range
+ #:type 'continuous
+ #:home-value attr-home-value
+ #:comment comment))
((_ attr-name attr-range attr-home-value)
(make <fixture-attribute>
#:name attr-name
@@ -115,11 +127,24 @@
#:name attr-name
#:range attr-allowed-values
#:type 'list
- #:home-value attr-home-value))))
+ #:home-value attr-home-value))
+ ((_ attr-name attr-allowed-values attr-home-value comment)
+ (make <fixture-attribute>
+ #:name attr-name
+ #:range attr-allowed-values
+ #:type 'list
+ #:home-value attr-home-value
+ #:comment comment))))
(define-syntax attr-colour
(syntax-rules ()
+ ((_ attr-name attr-home-value comment)
+ (make <fixture-attribute>
+ #:name attr-name
+ #:type 'colour
+ #:home-value attr-home-value
+ #:comment comment))
((_ attr-name attr-home-value)
(make <fixture-attribute>
#:name attr-name