Subject: Re: [bug#43064] [PATCH] gexp: computed-file: Prevent mistakenly overriding default option values.

From: Ludovic Courtès <[email-masked]>
Date: Sun, 30 Aug 2020 21:41:11 +0200

Hi,

Maxim Cournoyer <[email-masked]> skribis:

> Because the options are passed as a list rather than actual keyword arguments,
> omitting to repeat the default values in that list easily causes the default
> values to be lost.
>
> * guix/gexp.scm (%computed-file-default-options): New variable.
> (alist->plist): New procedure.
> (computed-file-combine-options-with-defaults): New procedure.
> (computed-file): Use the above procedures to form the default OPTIONS value.
> Update doc.  Use the COMPUTED-FILE-COMBINE-OPTIONS-WITH-DEFAULTS procedure to
> combine the user options with the default options, when they aren't
> overridden.
> * tests/gexp.scm ("computed-file options defaults honored")
> ("computed-file options defaults overridden"): Add tests.

How about exposing some of the relevant options as keywords?  We can
keep #:options as an “escape hatch” and add things like like
#:local-build? etc.  That would be simpler and more idiomatic.

Thanks,
Ludo’.