Maxim Cournoyer b7297d66c5
services: configuration: Add a define-maybe/no-serialization syntax.
Before this change, using define-maybe along define-configuration with the
no-serialization syntactic keyword would result in the following warning:

  warning: possibly unbound variable `VARIABLE-NAME'

This change introduces the define-maybe/no-serialization variant that does
away with defining a serialization helper procedure, which makes it possible
to avoid the above warning.

* gnu/services/configuration.scm (define-maybe/no-serialization): New syntax.
(define-maybe-helper): New procedure.
(define-maybe): Define syntax using the above procedure.
* tests/services/configuration.scm (tests): Fix module name.
(custom-number-serializer): Do not print to standard output.
(maybe-number?, serialize-maybe-number): New procedures defined via the
define-maybe macro.
(config-with-maybe-number): New configuration.
(serialize-number): New procedure.
("maybe value serialization"): New test.
(maybe-string?): New procedure defined via the define-maybe/no-serialization
macro.
(config-with-maybe-string/no-serialization): New configuration.
("maybe value without serialization no procedure bound"): New test.
2021-05-17 23:27:39 -04:00
..
2020-05-04 09:56:12 +02:00
2020-12-21 17:47:35 +01:00
2020-05-04 09:56:12 +02:00
2020-05-04 09:56:12 +02:00
2020-05-04 09:56:12 +02:00
2020-06-05 22:54:06 +02:00
2020-06-05 22:54:06 +02:00
2021-03-06 11:41:48 +01:00
2020-12-09 22:25:17 +01:00
2021-04-12 18:42:22 +02:00
2021-02-01 17:32:31 +01:00
2021-05-16 23:28:11 +02:00
2020-05-04 09:56:12 +02:00
2019-03-24 00:13:53 +01:00
2019-04-10 17:09:47 +02:00
2021-03-06 11:41:48 +01:00
2019-06-14 21:57:39 +02:00
2021-02-03 12:41:28 +01:00