unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Josselin Poiret <dev@jpoiret.xyz>
To: "Hartmut Goebel" <h.goebel@crazy-compilers.com>,
	"Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: G-exps: thunk instead of top-level references?
Date: Sun, 10 Mar 2024 10:58:19 +0100	[thread overview]
Message-ID: <87jzmammro.fsf@jpoiret.xyz> (raw)
In-Reply-To: <fea8d7d0-4be0-5389-e20e-af535488909d@crazy-compilers.com>

[-- Attachment #1: Type: text/plain, Size: 1522 bytes --]

Hi Hartmut,

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

> Hi Ludio,
>
> I'd like to get some advice:
>
> In commit 84c3aafb5a18ad278bbb36df7b70849fe05789c8 "trytond: Avoid top-level references to other modules"
> your turned a top-level variable which defines into a thunk:
>
> <https://git.savannah.gnu.org/cgit/guix.git/commit/?id=84c3aafb5a18ad278bbb36df7b70849fe05789c8>
>
>  -(define %standard-trytond-native-inputs
>  +(define (%standard-trytond-native-inputs)
>     `(("python-dateutil" ,python-dateutil)
>
> and the users:
>
>       (native-inputs
>  -     `(,@%standard-trytond-native-inputs
>  +     `(,@(%standard-trytond-native-inputs)
>          ("trytond-purchase" ,trytond-purchase)))
>
> I'm about to change the uses into G-exprs (see below) and wonder whether "%standard-trytond-native-inputs"
> should still be a thunk or can be turned pack into a top-level variable.
>
>  -(define (%standard-trytond-native-inputs) 
>  -  `(("python-dateutil" ,python-dateutil) 
>  +(define %standard-trytond-native-inputs 
>  +  (list python-dateutil
>
> and uses
>
>  -    (native-inputs (%standard-trytond-native-inputs))
>  +    (native-inputs
>  +     (cons* trytond-account-payment-clearing
>  +            %standard-trytond-native-inputs))
>   

Yes it still needs to be a thunk for the same reason: no top-level
references to packages in other modules.  By the way, (list ...) is not
a G-exp, it's rather the new input style.

Best,
-- 
Josselin Poiret

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 682 bytes --]

      reply	other threads:[~2024-03-10  9:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06 10:07 G-exps: thunk instead of top-level references? Hartmut Goebel
2024-03-10  9:58 ` Josselin Poiret [this message]

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=87jzmammro.fsf@jpoiret.xyz \
    --to=dev@jpoiret.xyz \
    --cc=guix-devel@gnu.org \
    --cc=h.goebel@crazy-compilers.com \
    --cc=ludo@gnu.org \
    /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).