guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: #:modules and #:imported-modules, and more


From: Ludovic Courtès
Subject: Re: #:modules and #:imported-modules, and more
Date: Tue, 09 Jan 2024 23:49:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]