From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Why is "append" the activation service's "compose" procedure? Date: Mon, 26 Mar 2018 15:02:36 +0200 Message-ID: <87zi2vdm6r.fsf@gnu.org> References: <87muyzdrjq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0Rlr-0002Z6-S3 for guix-devel@gnu.org; Mon, 26 Mar 2018 09:02:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0Rln-0002Bv-Vx for guix-devel@gnu.org; Mon, 26 Mar 2018 09:02:43 -0400 Received: from hera.aquilenet.fr ([2a0c:e300::1]:48016) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f0Rln-0002BD-Ox for guix-devel@gnu.org; Mon, 26 Mar 2018 09:02:39 -0400 In-Reply-To: <87muyzdrjq.fsf@gmail.com> (Chris Marusich's message of "Fri, 23 Mar 2018 11:17:45 +0100") 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: Chris Marusich Cc: guix-devel@gnu.org Hello, Chris Marusich skribis: > This is our current definition of the activation-service-type (in (gnu > services)): > > (define activation-service-type > (service-type (name 'activate) > (extensions > (list (service-extension boot-service-type > gexps->activation-gexp))) > (compose append) > (extend second-argument))) > > Note that the the append procedure is used as the "compose" procedure. > However, fold-services applies the "compose" procedure to a single list. > What happens when you apply the append procedure to a single list? You > get the same list back: > > scheme@(guile-user)> (define mylist '(1 2 3)) > scheme@(guile-user)> (append mylist) > $1 =3D (1 2 3) > scheme@(guile-user)> (eq? mylist (append mylist)) > $2 =3D #t > > The fold-services procedure always applies the "compose" procedure to a > single list. So why does the activation-service-type use the append > procedure as its "compose" procedure? Wouldn't it more accurately > reflect our intent if we used the identity procedure instead? Yes, you=E2=80=99re right here as well. :-) =E2=80=98boot-service-type=E2=80=99 has the same problem. Can you fix both? Thanks! Ludo=E2=80=99.