unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: guix-devel@gnu.org
Subject: Re: #:modules and #:imported-modules, and more
Date: Tue, 09 Jan 2024 23:49:33 +0100	[thread overview]
Message-ID: <878r4yxgua.fsf@gnu.org> (raw)
In-Reply-To: <ZZATI4I5FRvdhpXu@ws> (Tomas Volf's message of "Sat, 30 Dec 2023 13:54:59 +0100")

Hello!

Tomas Volf <~@wolfsden.cz> skribis:

>   As seen in the example above, currently there is a need to manually
>   merge the list of additional modules with the original one.  Failing
>   to use the correct base can lead to issues (like crash in netsurf).
>
>   I would like to propose adding two new fields into the build system,
>   `#:extra-modules' and `#:extra-imported-modules'.  Those would be
>   automatically appended to the `#:modules' and `#:imported-modules',
>   removing the need to merge the lists in the package definition.
>   Therefore the example above would turn into:

As a rule of thumb, I personally always avoid the #:extra-things
pattern, instead letting users pass #:things in their entirety and
documenting the default value.

I believe (1) this is clearer (when I see “extra”, I’m always like “extra
compared to what?”), and (2) it gives more control over the things in
question (since one can also remove stuff from the default value).

So yes, that’s a bit more boilerplate when all you want is import one
additional module, but I think it’s overall a better interface than
#:extra.

I hope this makes sense!

Ludo’.


  reply	other threads:[~2024-01-09 22:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-30 12:54 #:modules and #:imported-modules, and more Tomas Volf
2024-01-09 22:49 ` Ludovic Courtès [this message]
2024-01-09 23:09   ` Tomas Volf
2024-01-10 10:23     ` Ludovic Courtès
2024-01-10 16:43       ` Tomas Volf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878r4yxgua.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).