unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Josselin Poiret via Bug reports for GNU Guix <bug-guix@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Justin Veilleux <terramorpha@cock.li>, 68413@debbugs.gnu.org
Subject: bug#68413: Ungexp doesn't work on deep lists
Date: Mon, 15 Jan 2024 17:28:47 +0100	[thread overview]
Message-ID: <87bk9m1ry8.fsf@jpoiret.xyz> (raw)
In-Reply-To: <87le8rj5dp.fsf@gnu.org>

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

Hi Ludo,

Ludovic Courtès <ludo@gnu.org> writes:

> Actually, what bug are we talking about?  It seems to work for me with
> this example:
>
> --8<---------------cut here---------------start------------->8---
> scheme@(guile-user)> (define packages `(("coreutils" ,coreutils) ("make" ,gnu-make)))
> scheme@(guile-user)> ,build (scheme-file "foo" #~(begin '#$packages))
> building /gnu/store/lq9gvbilv0y2nph00zxk6bn3lvcgdxqq-foo.drv...
> $7 = "/gnu/store/9ryh6v80jvjv3kwx0q782h26h9gbaclj-foo"
> scheme@(guile-user)> (call-with-input-file $7 get-string-all)
> $8 = "(begin (quote ((\"coreutils\" \"/gnu/store/mppp9hwxizx9g9pikwcvvshb2ffxyq7p-coreutils-9.1\") (\"make\" \"/gnu/store/9fadhs5qmwl5x7f669a0v39b3ryrmmf1-make-4.3\"))))"
> --8<---------------cut here---------------end--------------->8---
>
> One of the design decisions for gexps was to ensure that substituting a
> file-like object by its file name would be O(1) in most cases.
>
> Substitution in lists as in the example above is supported, but
> primarily for backward compatibility.  It should be avoided when
> possible because it’s inefficient: ‘gexp->sexp’ needs to traverse the
> whole list/tree in search of potential candidates.

Notice that OP's example uses `(("thing" . ,package)), ie. lists of
pairs and not lists of lists, as in your case!

Best,
-- 
Josselin Poiret

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

      reply	other threads:[~2024-01-15 16:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-13  1:52 bug#68413: Ungexp doesn't work on deep lists Justin Veilleux
2024-01-13 11:38 ` Josselin Poiret via Bug reports for GNU Guix
2024-01-15  9:46   ` Ludovic Courtès
2024-01-15 16:28     ` Josselin Poiret via Bug reports for GNU Guix [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=87bk9m1ry8.fsf@jpoiret.xyz \
    --to=bug-guix@gnu.org \
    --cc=68413@debbugs.gnu.org \
    --cc=dev@jpoiret.xyz \
    --cc=ludo@gnu.org \
    --cc=terramorpha@cock.li \
    /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).