unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Hilton Chain <hako@ultrarare.space>
To: Hartmut Goebel <h.goebel@crazy-compilers.com>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: Simple design question for schemers
Date: Sat, 24 Feb 2024 23:55:12 +0800	[thread overview]
Message-ID: <878r39j1r3.wl-hako@ultrarare.space> (raw)
In-Reply-To: <f300904c-80ed-7ec6-26c5-4119fff23225@crazy-compilers.com>

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	other threads:[~2024-02-24 15:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-24 13:47 Simple design question for schemers Hartmut Goebel
2024-02-24 15:55 ` Hilton Chain [this message]
2024-02-25 10:05 ` Ricardo Wurmus
2024-03-01 15:02   ` Hartmut Goebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878r39j1r3.wl-hako@ultrarare.space \
    --to=hako@ultrarare.space \
    --cc=guix-devel@gnu.org \
    --cc=h.goebel@crazy-compilers.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).