GNU bug report logs - #52749
G-expressions don't consistently preserve #nil

Previous Next

Package: guix;

Reported by: Philip McGrath <philip <at> philipmcgrath.com>

Date: Thu, 23 Dec 2021 04:32:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Maxime Devos <maximedevos <at> telenet.be>
To: Philip McGrath <philip <at> philipmcgrath.com>, 52749 <at> debbugs.gnu.org
Subject: bug#52749: G-expressions don't consistently preserve #nil
Date: Mon, 03 Jan 2022 10:28:34 +0000
[Message part 1 (text/plain, inline)]
Philip McGrath schreef op ma 27-12-2021 om 13:38 [-0500]:
> I think the behavior of `gexp->approximate-sexp` is at least defensible, 
> since its documentation (`info guix "gexp->approximate-sexp"`) warns 
> that "some information can be lost".

But no information is lost in this case?

$ guix repl
> (use-modules (guix gexp))
> (gexp->approximate-sexp #~(a . #nil))
$1 = (a) ; sure, the #nil isn't printed ...
> (cdr $1)
$2 = () ; ... also not printed ...
> (values (eq? (cdr $1) #nil) (eq? (cdr $1) '()))
$3 = #t ; but it's still there!
$4 = #f

Greetings,
Maxime
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 3 years and 168 days ago.

Previous Next


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