guix-devel
[Top][All Lists]
Advanced

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

Re: Layout of ‘define-configuration’ records


From: Ludovic Courtès
Subject: Re: Layout of ‘define-configuration’ records
Date: Mon, 21 Nov 2022 11:26:32 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

> A side-note, it seems that Ludovic has been
> working toward eliminating the use of match patterns matching the fields
> directly, instead encouraging the use of 'match-record', see
> https://issues.guix.gnu.org/59390.  I haven't checked if this is
> compatible with define-configuration records though.

It is: ‘define-configuration’ builds on ‘define-record-type*’, which
builds on SRFI-9, which builds on Guile “records”, which builds on Guile
“structs”.  :-)

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> ,m (gnu home services desktop)
scheme@(gnu home services desktop)> (home-redshift-configuration)
$1 = #<<home-redshift-configuration> redshift: #<package redshift@1.12 
gnu/packages/xdisorg.scm:1430 7f155c3ae210> location-provider: geoclue2 
adjustment-method: randr daytime-temperature: 6500 nighttime-temperature: 4500 
daytime-brightness: %unset-marker% nighttime-brightness: %unset-marker% 
latitude: %unset-marker% longitude: %unset-marker% dawn-time: %unset-marker% 
dusk-time: %unset-marker% extra-content: "" %location: #f>
scheme@(gnu home services desktop)> (match-record $1 
<home-redshift-configuration> (adjustment-method nighttime-temperature)
... (list nighttime-temperature adjustment-method))
$2 = (4500 randr)
--8<---------------cut here---------------end--------------->8---

Ludo’.



reply via email to

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