[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Incorrect service documentation?
From: |
Chris Marusich |
Subject: |
Re: Incorrect service documentation? |
Date: |
Thu, 29 Mar 2018 07:38:11 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
address@hidden (Ludovic Courtès) writes:
> Hello!
>
> Chris Marusich <address@hidden> skribis:
>
>> Is the description of "compose" correct? The manual claims that it
>> "must return a value that is a valid parameter value for the service
>> instance," but I do not think that is actually true. Judging by the
>> implementation of fold-services in (gnu services), it may return any
>> single value as long as the extend procedure knows how to handle it. In
>> fact, it is the "extend" procedure which must return a valid parameter
>> value for the service.
>
> Yes, you’re right! Good catch.
Thank you for confirming my understanding!
>> If this is true, then I suggest we change the documentation as follows:
>>
>> ‘compose’ (default: ‘#f’)
>> If this is ‘#f’, then the service type denotes services that
>> cannot be extended—i.e., services that do not receive “values”
>> from other services.
>>
>> Otherwise, it must be a one-argument procedure. The procedure
>> is called by ‘fold-services’ and is passed a list of values
>> collected from extensions. It may return any single value.
>>
>> ‘extend’ (default: ‘#f’)
>> If this is ‘#f’, services of this type cannot be extended.
>>
>> Otherwise, it must be a two-argument procedure:
>> ‘fold-services’ calls it, passing it the initial value of the
>> service as the first argument and the result of applying
>> ‘compose’ to the extension values as the second argument. It
>> must return a value that is a valid parameter value for the
>> service instance.
>>
>> What do you think?
>
> LGTM!
I've committed this as 881c61d06222a30dbffbf9d039eaca2abd3d22b3.
--
Chris
signature.asc
Description: PGP signature