Multiple instances of same option

It can be useful to allow users to provide options more than once. For example, the Guix Workflow Language accepts the "--input" option more than once. All values provided will be collated.

E.g.

guix workflow run --input=foo --input=bar --input=baz

This is not possible with Guile Config, because only the last option remains accessible (so (option-ref opts 'input) yields "baz").

It would be nice if an optional merge strategy could be provided. The default is to replace values. A merge strategy could be provided as a procedure, e.g.:

(lambda (elem previous)
  (if (pair? previous)
    (cons elem previous)
    (list elem previous))

What do you think?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information