Subject: bug#52749: G-expressions don't consistently preserve #nil

From: Maxime Devos <[email-masked]>
Date: Mon, 03 Jan 2022 10:28:34 +0000

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