From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Marusich Subject: Re: Incorrect service documentation? Date: Thu, 29 Mar 2018 07:38:11 +0200 Message-ID: <87lgebsapo.fsf@gmail.com> References: <87r2obdrxd.fsf@gmail.com> <878taff103.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f1QGP-00006f-Kc for guix-devel@gnu.org; Thu, 29 Mar 2018 01:38:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f1QGO-00078k-Ll for guix-devel@gnu.org; Thu, 29 Mar 2018 01:38:17 -0400 In-Reply-To: <878taff103.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 26 Mar 2018 14:57:16 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Hello! > > Chris Marusich 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=E2=80=99re right! Good catch. Thank you for confirming my understanding! >> If this is true, then I suggest we change the documentation as follows: >> >> =E2=80=98compose=E2=80=99 (default: =E2=80=98#f=E2=80=99) >> If this is =E2=80=98#f=E2=80=99, then the service type denotes= services that >> cannot be extended=E2=80=94i.e., services that do not receive = =E2=80=9Cvalues=E2=80=9D >> from other services. >> >> Otherwise, it must be a one-argument procedure. The procedure >> is called by =E2=80=98fold-services=E2=80=99 and is passed a l= ist of values >> collected from extensions. It may return any single value. >> >> =E2=80=98extend=E2=80=99 (default: =E2=80=98#f=E2=80=99) >> If this is =E2=80=98#f=E2=80=99, services of this type cannot = be extended. >> >> Otherwise, it must be a two-argument procedure: >> =E2=80=98fold-services=E2=80=99 calls it, passing it the initi= al value of the >> service as the first argument and the result of applying >> =E2=80=98compose=E2=80=99 to the extension values as the secon= d 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. =2D-=20 Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAlq8e8MACgkQ3UCaFdgi Rp2Zpw//eYPN5ksqL9y7hC374PV4KDTjgFphKPN2+74UDvfr96VCkLkeMCEIGOXN xQhpoy6QISBMf+z8mGjgCF+WdH3PLHxsaLUO7xPBxvZuilFka8gV5ZIYtvtMBmZn rFqcviBTnXI1vkQfbO5oXRq7utNS2aRidez3pgP+5S/4MYZEv6/H5yzNMnYcnPOb MI141VZsp8sp6i9zlzN7sUCMClaiEKWN4te5uFBZF29MF6W40eXnv5xe6UxoX/Y2 IsOuvZncZhSlWXlHUZDGZRakV8rjioxwnCL9LaJIo4l+a/T71JtiXhUzdIn8pIVH ZWPbJqJfslQu/9HxdQoGT8/L7AV+QfLpfsSYWCdpCBjK9EI9BRNNKYu7yktzcbp/ A3EpJhDPovHcj/qMrpVfr/lGPZzjU6io+CQ2YihT6wA6QZqS2mBv4hBj+zxRvomN elgfdYCsx53c7jWdHs1xPvFxpu7EOIu6eEAG0+0beAVEyuLZvo1V1x0i7dZKCtKW BSxInYY8ggHfH1z6hajrYqvLV868JrKqeYm4QC+xt0BS3S3pjB3k8qBpSDHUYGYz gwZ2YqXATHfQlnI44YDqZJbJmnekJSpxzSoiLiEpiCbABo8VxPpJQ5nfA38uS8dP 97Bg6uKoaE6/B41el1z+mrBjlVrfjPudqGN1U1gnNUU28bhI47k= =Reg8 -----END PGP SIGNATURE----- --=-=-=--