all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Simple design question for schemers
@ 2024-02-24 13:47 Hartmut Goebel
  2024-02-24 15:55 ` Hilton Chain
  2024-02-25 10:05 ` Ricardo Wurmus
  0 siblings, 2 replies; 4+ messages in thread
From: Hartmut Goebel @ 2024-02-24 13:47 UTC (permalink / raw)
  To: Guix-devel

[-- Attachment #1: Type: text/html, Size: 2399 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Simple design question for schemers
  2024-02-24 13:47 Simple design question for schemers Hartmut Goebel
@ 2024-02-24 15:55 ` Hilton Chain
  2024-02-25 10:05 ` Ricardo Wurmus
  1 sibling, 0 replies; 4+ messages in thread
From: Hilton Chain @ 2024-02-24 15:55 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: Guix-devel

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Simple design question for schemers
  2024-02-24 13:47 Simple design question for schemers Hartmut Goebel
  2024-02-24 15:55 ` Hilton Chain
@ 2024-02-25 10:05 ` Ricardo Wurmus
  2024-03-01 15:02   ` Hartmut Goebel
  1 sibling, 1 reply; 4+ messages in thread
From: Ricardo Wurmus @ 2024-02-25 10:05 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel


Hartmut Goebel <h.goebel@crazy-compilers.com> writes:

> Using a custom function "extend":
>
>     (native-inputs
>      (extend %standard-trytond-native-inputs
>              trytond-account-invoice
>              trytond-purchase
>              trytond-sale))

We have a macro called MODIFY-INPUTS, which you could use, but CONS* is
probably enough in your case.

-- 
Ricardo


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Simple design question for schemers
  2024-02-25 10:05 ` Ricardo Wurmus
@ 2024-03-01 15:02   ` Hartmut Goebel
  0 siblings, 0 replies; 4+ messages in thread
From: Hartmut Goebel @ 2024-03-01 15:02 UTC (permalink / raw)
  To: Ricardo Wurmus, Hilton Chain; +Cc: guix-devel

Hi both of you,

Am 25.02.24 um 11:05 schrieb Ricardo Wurmus:
> We have a macro called MODIFY-INPUTS, which you could use, but CONS* is
> probably enough in your case.

Thanks. I'm using cons* now.

cons* basically is the same the "extend" I'm used to from Python - sadly 
the Guile manual is so terrible to understand that I did not get that.


-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-01 15:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-24 13:47 Simple design question for schemers Hartmut Goebel
2024-02-24 15:55 ` Hilton Chain
2024-02-25 10:05 ` Ricardo Wurmus
2024-03-01 15:02   ` Hartmut Goebel

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.