guix-devel
[Top][All Lists]
Advanced

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

Re: Simple design question for schemers


From: Hilton Chain
Subject: Re: Simple design question for schemers
Date: Sat, 24 Feb 2024 23:55:12 +0800

Hi Hartmut,

On Sat, 24 Feb 2024 21:47:41 +0800,
Hartmut Goebel wrote:
>
> Hi,
>
> I'm about to refactor the Tryton packages to the (not so) new style. Now the 
> trytond-xxx modules all share a basic list of native
> inputs,like this:
>
>     (native-inputs
>      `(,@(%standard-trytond-native-inputs)
>        ("trytond-account-fr" ,trytond-account-fr)
>        ("trytond-edocument-uncefact" ,trytond-edocument-uncefact)))
>
> Now I wonder what would be the most scheme-like way for doing this in new 
> style?
>
> Using "apply list":
>
>     (native-inputs (apply list
>                           trytond-account-fr
>                           trytond-edocument-uncefact
>                           %standard-trytond-native-inputs ))
>
> Using "append":
>
>     (native-inputs (append %standard-trytond-native-inputs
>                            (list trytond-account-fr
>                                  trytond-edocument-uncefact)))
>
> Using a custom function "extend":
>
>     (native-inputs
>      (extend %standard-trytond-native-inputs
>              trytond-account-invoice
>              trytond-purchase
>              trytond-sale))
>
> Using a custom function "@trytond-module-native-inputs":
>
>     (native-inputs (@trytond-module-native-inputs
>                     trytond-account-invoice
>                     trytond-purchase
>                     trytond-sale))
>
> Opinions?

You may want to use ‘cons*’:
--8<---------------cut here---------------start------------->8---
(cons* trytond-account-fr
       trytond-edocument-uncefact
       %standard-trytond-native-inputs)
--8<---------------cut here---------------end--------------->8---


Thanks



reply via email to

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