Message ID | 20220131152753.19880-1-attila@lendvai.name |
---|---|
State | Accepted |
Headers | show |
Series | [bug#53663] gnu: services: Also accept 'undefined in maybe-foo? constructs. | expand |
Context | Check | Description |
---|---|---|
cbaines/comparison | success | View comparision |
cbaines/git branch | success | View Git branch |
cbaines/applying patch | success | View Laminar job |
cbaines/issue | success | View issue |
> What would be different here?
the possibility of writing:
(define-configuration my-cfg
(my-field (maybe-string)))
versus now having to write:
(define-configuration my-cfg
(my-field (maybe-string 'disabled)))
but now that i thought about it, i think everyone is better off if i
deal with this on my side, instead of having a discussion about the
exact shape of a bandaid.
closing this for now; more later in the form of a proper cleanup
proposal of the configuration code.
--
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“There can be no greater stretch of arbitrary power than is required to seize children from their parents, teach them whatever the authorities decree they shall be taught, and expropriate from the parents the funds to pay for the procedure.”
— Isabel Paterson (1886–1961), 'The God of the Machine' (1943)
diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm index 0de350a4df..c5f276eab5 100644 --- a/gnu/services/configuration.scm +++ b/gnu/services/configuration.scm @@ -141,7 +141,9 @@ (define (define-maybe-helper serialize? prefix syn) (id #'stem #'serialize-maybe- #'stem)))) #`(begin (define (maybe-stem? val) - (or (eq? val 'disabled) (stem? val))) + (or (eq? val 'disabled) + (eq? val 'undefined) + (stem? val))) #,@(if serialize? (list #'(define (serialize-maybe-stem field-name val) (if (stem? val)