GNU bug report logs - #43064
[PATCH] gexp: computed-file: Prevent mistakenly overriding default option values.

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Thu, 27 Aug 2020 05:15:01 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 43064 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 43064 <at> debbugs.gnu.org
Subject: Re: [bug#43064] [PATCH] gexp: computed-file: Prevent mistakenly
 overriding default option values.
Date: Sun, 30 Aug 2020 21:41:11 +0200
Hi,

Maxim Cournoyer <maxim.cournoyer <at> 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’.




This bug report was last modified 4 years and 261 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.