On Thu, Apr 22 2021, raingloom wrote: >> One thing that I find a little annoying is that you have to specify a >> default value for the fields. > > Are you sure? If you don't specify a default, won't the user just be > forced to write > (service whatever > (whatever-configuration > (mandatory-field 'bleepbloop))) > > instead of the shorter (service whatever)?
If I write something like this #+begin_src scheme (use-modules (gnu services configuration)) (define (serialize-list field-name val) "") (define-configuration test-config (config (list) "configuration for test")) #+end_src and evaluate it, I will get an error. I have to specify a default value for the ‘config’ field to make it work. #+begin_src scheme (use-modules (gnu services configuration)) (define (serialize-list field-name val) "") (define-configuration test-config (config (list '()) ;default to '() "configuration for test")) #+end_src