Subject: bug#59747: closed (Re: bug#59747: [PATCH] services: configuration: rework alist? procedure)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 21 Mar 2023 13:53:02 +0000

Your bug report

#59747: [PATCH] services: configuration: rework alist? procedure

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
59747: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59747
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#59747: [PATCH] services: configuration: rework alist? procedure
From: Maxim Cournoyer <[email-masked]>
To: Bruno Victal <[email-masked]>
Cc: [email-masked]
Date: Tue, 21 Mar 2023 09:52:02 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Bruno Victal <[email-masked]> writes:

> * gnu/services/configuration.scm (alist?): simplify procedure.
> ---
>
> Last patch was sent without prefix.
>
>  gnu/services/configuration.scm | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
> index 6b0291dc00..d4d9c3b1a6 100644
> --- a/gnu/services/configuration.scm
> +++ b/gnu/services/configuration.scm
> @@ -437,10 +437,7 @@ (define list-of-strings?
>    (list-of string?))
>  
>  (define alist?
> -  (match-lambda
> -    (() #t)
> -    ((head . tail) (and (pair? head) (alist? tail)))
> -    (_ #f)))
> +  (list-of pair?))

Applied, thanks!

-- 
Thanks,
Maxim

Subject: [PATCH] services: configuration: rework alist? procedure
From: [email-masked]
To: [email-masked]
Cc: Bruno Victal <[email-masked]>
Date: Thu, 1 Dec 2022 18:09:47 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

From: Bruno Victal <[email-masked]>

* 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