guix-devel
[Top][All Lists]
Advanced

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

Re: using an SRFI that is not available in Guile


From: Ludovic Courtès
Subject: Re: using an SRFI that is not available in Guile
Date: Mon, 24 Jan 2022 16:41:30 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Hi,

Attila Lendvai <attila@lendvai.name> skribis:

>> Out of curiosity, in what case do you need to represent “unset fields”?
>
>
> i think an example works better here: consider Swarm, a p2p storage
> solution. its node implementation is called Bee. bees can join
> swarms. there are some well-known swarms: 'testnet' and 'mainnet'.
>
> when someone specifies the swarm field as a symbol naming one of the
> well-known swarms, then some other mandatory fields should default to
> the appropriate values derived from it, *and* the service should warn
> if those fields are also set by the user.
>
> and when one is joining a custom swarm, as per giving a string name in
> the swarm field, then the service should warn when these mandatory
> fields are not explicitly specified.

I see.  The ‘define-configuration’ macro uses 'disabled as a way to
indicate fields that have not been user-specified.  Would that be of any
help in this context?

Another approach would be to use ‘define-record-type*’ and record all
the default values, including those derived from other fields (just like
the default ‘home-directory’ field of <user-account> is derived from
‘name’.)

Does that make sense?

Ludo’.



reply via email to

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