guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 1/6] guix system: Export <boot-parameters> accessors.


From: Ludovic Courtès
Subject: Re: [PATCH 1/6] guix system: Export <boot-parameters> accessors.
Date: Wed, 13 Jan 2016 23:33:37 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Alex Kost <address@hidden> skribis:

> Ludovic Courtès (2016-01-12 23:25 +0300) wrote:
>
>> Alex Kost <address@hidden> skribis:
>>
>>> * guix/scripts/system.scm (read-boot-parameters, boot-parameters)
>>> (boot-parameters?, boot-parameters-label, boot-parameters-root-device)
>>> (boot-parameters-kernel, boot-parameters-kernel-arguments): Export.
>>
>> LGTM.
>>
>> Eventually (as a replacement of this patch or as a subsequent patch, as
>> you prefer) we should move these to (gnu system) since this is where we
>> create the ‘boot-parameters’ sexp.
>
> Great, I would like to make a replacement.  OK for the attached patch?
>
> (I exported <boot-parameters> because it is used by (guix scripts system))

I usually avoid exporting record type descriptors (RTDs) like
<boot-parameters> because then, if you change the layout of fields, you
have to update every ‘match’ clause out there, and it can be tedious and
error-prone.  Also, if the RTD is exported, then it’s trivial for other
modules to forge records of that type.

Could you instead rewrite the two occurrences in (guix system scripts)
so they use the ‘boot-parameters-XYZ’ accessors instead of ‘match’?  A
bit more verbose, but safer.

Sorry that I didn’t clarify this before!

Thanks,
Ludo’.



reply via email to

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