guix-devel
[Top][All Lists]
Advanced

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

Re: Why is "append" the activation service's "compose" procedure?


From: Ludovic Courtès
Subject: Re: Why is "append" the activation service's "compose" procedure?
Date: Mon, 26 Mar 2018 15:02:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Hello,

Chris Marusich <address@hidden> 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 = (1 2 3)
>   scheme@(guile-user)> (eq? mylist (append mylist))
>   $2 = #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’re right here as well.  :-)

‘boot-service-type’ has the same problem.

Can you fix both?

Thanks!

Ludo’.



reply via email to

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