[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#43064] [PATCH] gexp: computed-file: Prevent mistakenly overriding d
From: |
Ludovic Courtès |
Subject: |
[bug#43064] [PATCH] gexp: computed-file: Prevent mistakenly overriding default option values. |
Date: |
Sun, 30 Aug 2020 21:41:11 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Hi,
Maxim Cournoyer <maxim.cournoyer@gmail.com> 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’.