From: Edouard Klein <edou@rdklein.fr>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: help-guix@gnu.org
Subject: Re: I think thunked fields are breaking my previously working code
Date: Sun, 27 Feb 2022 21:35:21 +0100 [thread overview]
Message-ID: <8735k4gi78.fsf@rdklein.fr> (raw)
In-Reply-To: <877db78dr0.fsf@elephly.net>
Thank you so much Ricardo, you have no idea how big of a thorn you
removed from my side. I owe you one.
Ricardo Wurmus <rekado@elephly.net> writes:
> edk@beaver-labs.com writes:
>
>> For example, given that "minimal-container" is an operating system, I
>> can do the following:
>>
>> (set-fields minimal-container ((operating-system-host-name) "toto"))
>>
>> But not:
>>
>> (set-fields minimal-container ((operating-system-label) "toto"))
>
> In Guile we usually try to avoid mutation like that. The records API
> allows you to use inheritance instead:
>
> (operating-system
> (inherit minimal-container)
> (label "toto"))
>
> Thunking just means that the field is a procedure that returns a value
> when called with no arguments. The records in (guix records) are not
> plain SRFI9 records, so I would not expect set-fields to work at all.
prev parent reply other threads:[~2022-02-27 20:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-10 17:55 I think thunked fields are breaking my previously working code edk
2022-01-10 21:39 ` Ricardo Wurmus
2022-02-27 20:35 ` Edouard Klein [this message]
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=8735k4gi78.fsf@rdklein.fr \
--to=edou@rdklein.fr \
--cc=help-guix@gnu.org \
--cc=rekado@elephly.net \
/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.
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).