GNU bug report logs - #68413
Ungexp doesn't work on deep lists

Previous Next

Package: guix;

Reported by: Justin Veilleux <terramorpha <at> cock.li>

Date: Sat, 13 Jan 2024 01:53:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Josselin Poiret <dev <at> jpoiret.xyz>
To: Justin Veilleux <terramorpha <at> cock.li>, 68413 <at> debbugs.gnu.org
Subject: bug#68413: Ungexp doesn't work on deep lists
Date: Sat, 13 Jan 2024 12:38:38 +0100
[Message part 1 (text/plain, inline)]
Hi Justin,

Justin Veilleux <terramorpha <at> cock.li> writes:

>> (define packages
>>         (list
>>          (cons "coreutils" coreutils)
>>          (cons "make" gnu-make)
>>          ...))
>>
>> #~(for-each
>>    (lambda (f)
>>      ... do-something)
>>    '#$packages)
>
> If I send a patch to "fix" this, will it be usefull or is there a reason
> for this behavior?

I think IMO that it's a bug, but it's also quite tricky to properly
traverse deep structures like this.  The bug comes from the fact that in
gexp->sexp, we traverse lists by matching the reference with (refs ...),
but that doesn't match if the reference is a pair instead.  Then, it
tries to match with ($ <gexp-input> (? self-quoting? x)), which does
match since self-quoting? apparently returns #t on a pair, whether or
not its constituents are also self-quoting.

Best,
-- 
Josselin Poiret
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 1 year and 150 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.