GNU bug report logs - #59747
[PATCH] services: configuration: rework alist? procedure

Previous Next

Package: guix-patches;

Reported by: mirai <at> makinata.eu

Date: Thu, 1 Dec 2022 18:11:02 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#59747: closed ([PATCH] services: configuration: rework alist?
 procedure)
Date: Thu, 08 Dec 2022 12:00:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 08 Dec 2022 12:59:05 +0100
with message-id <87wn72ds3a.fsf <at> gnu.org>
and subject line Re: bug#59747: [PATCH] services: configuration: rework alist? procedure
has caused the debbugs.gnu.org bug report #59747,
regarding [PATCH] services: configuration: rework alist? procedure
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
59747: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59747
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: mirai <at> makinata.eu
To: guix-patches <at> gnu.org
Cc: Bruno Victal <mirai <at> makinata.eu>
Subject: [PATCH] services: configuration: rework alist? procedure
Date: Thu,  1 Dec 2022 18:09:47 +0000
From: Bruno Victal <mirai <at> makinata.eu>

* gnu/services/configuration.scm: rework alist? procedure
---
 gnu/services/configuration.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
index dacfc52ba9..5bbb032c66 100644
--- a/gnu/services/configuration.scm
+++ b/gnu/services/configuration.scm
@@ -436,7 +436,11 @@ (define (list-of pred?)
 (define list-of-strings?
   (list-of string?))
 
-(define alist? list?)
+(define alist?
+  (match-lambda
+    (() #t)
+    ((and (= car head) (= cdr tail)) (and (pair? head) (alist? tail)))
+    (_ #f)))
 
 (define serialize-file-like empty-serializer)
 

base-commit: 748ec628826cea3faa3679074d87fae9bc810080
-- 
2.38.1



[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: mirai <at> makinata.eu
Cc: 59747-done <at> debbugs.gnu.org
Subject: Re: bug#59747: [PATCH] services: configuration: rework alist?
 procedure
Date: Thu, 08 Dec 2022 12:59:05 +0100
mirai <at> makinata.eu skribis:

> From: Bruno Victal <mirai <at> makinata.eu>
>
> * gnu/services/configuration.scm: rework alist? procedure

I simplified it a bit and applied.

Note that there are two other ‘*-alist?’ procedures…

But really, it’s the kind of predicate that shouldn’t be used because
there’s no disjoint alist data type in the first place.  It may be a
sign that we should use records instead in those places.

Thanks,
Ludo’.


This bug report was last modified 2 years and 154 days ago.

Previous Next


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