unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tomas Volf <~@wolfsden.cz>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: #:modules and #:imported-modules, and more
Date: Wed, 10 Jan 2024 00:09:08 +0100	[thread overview]
Message-ID: <ZZ3SFLKlCTtRGeBm@ws> (raw)
In-Reply-To: <878r4yxgua.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1853 bytes --]

On 2024-01-09 23:49:33 +0100, Ludovic Courtès wrote:
> 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).

Well you could still remove the default stuff, since the "non-extra" would not
be going anywhere.

>
> 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!

I see your point.  Not sure I fully agree, but do understand what you mean and
will not push on it further.

However even in that light, I still consider the 3 and 4 to be worth
considering.  Aaand even without 3, at least doing 4 in some shape or form would
be in my opinion useful.  Current situation is bit... copy&pasty.

Tomas

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-01-09 23:10 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
2024-01-09 23:09   ` Tomas Volf [this message]
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=ZZ3SFLKlCTtRGeBm@ws \
    --to=~@wolfsden.cz \
    --cc=guix-devel@gnu.org \
    --cc=ludo@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).