From 9336baf258d6fc19e5dfa5bcfc7892d239f24837 Mon Sep 17 00:00:00 2001 From: Bruno Victal Date: Thu, 1 Dec 2022 18:09:47 +0000 Subject: services: configuration: Rewrite 'alist?' procedure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/services/configuration.scm (alist?): Rewrite. Co-authored-by: Ludovic Courtès --- gnu/services/configuration.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm index 2b3bd4c1f4..10cb933ed1 100644 --- a/gnu/services/configuration.scm +++ b/gnu/services/configuration.scm @@ -436,7 +436,11 @@ the list result in @code{#t} when applying PRED? on them." (define list-of-strings? (list-of string?)) -(define alist? list?) +(define alist? + (match-lambda + (() #t) + ((head . tail) (and (pair? head) (alist? tail))) + (_ #f))) (define serialize-file-like empty-serializer) -- cgit v1.2.3