all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#59747] [PATCH] services: configuration: rework alist? procedure
@ 2022-12-01 18:09 mirai
  2022-12-08 11:59 ` bug#59747: " Ludovic Courtès
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: mirai @ 2022-12-01 18:09 UTC (permalink / raw)
  To: 59747; +Cc: Bruno Victal

From: Bruno Victal <mirai@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





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#59747: [PATCH] services: configuration: rework alist? procedure
  2022-12-01 18:09 [bug#59747] [PATCH] services: configuration: rework alist? procedure mirai
@ 2022-12-08 11:59 ` Ludovic Courtès
  2022-12-08 12:07 ` [bug#59747] [PATCH v2] " mirai
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2022-12-08 11:59 UTC (permalink / raw)
  To: mirai; +Cc: 59747-done

mirai@makinata.eu skribis:

> From: Bruno Victal <mirai@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’.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#59747] [PATCH v2] services: configuration: rework alist? procedure
  2022-12-01 18:09 [bug#59747] [PATCH] services: configuration: rework alist? procedure mirai
  2022-12-08 11:59 ` bug#59747: " Ludovic Courtès
@ 2022-12-08 12:07 ` mirai
  2023-01-25 16:37 ` [bug#59747] [PATCH] services: configuration: simplify " Bruno Victal
  2023-01-25 16:38 ` [bug#59747] [PATCH v3] " Bruno Victal
  3 siblings, 0 replies; 7+ messages in thread
From: mirai @ 2022-12-08 12:07 UTC (permalink / raw)
  To: 59747; +Cc: Bruno Victal

From: Bruno Victal <mirai@makinata.eu>

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

diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
index 2b3bd4c1f4..e0a5bd6728 100644
--- a/gnu/services/configuration.scm
+++ b/gnu/services/configuration.scm
@@ -436,7 +436,8 @@ (define (list-of pred?)
 (define list-of-strings?
   (list-of string?))
 
-(define alist? list?)
+(define alist?
+  (list-of pair?))
 
 (define serialize-file-like empty-serializer)
 

base-commit: fc774ece918d765f871d2fd079e622188e23f2da
-- 
2.38.1





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#59747] [PATCH] services: configuration: simplify alist? procedure.
  2022-12-01 18:09 [bug#59747] [PATCH] services: configuration: rework alist? procedure mirai
  2022-12-08 11:59 ` bug#59747: " Ludovic Courtès
  2022-12-08 12:07 ` [bug#59747] [PATCH v2] " mirai
@ 2023-01-25 16:37 ` Bruno Victal
  2023-01-25 16:38 ` [bug#59747] [PATCH v3] " Bruno Victal
  3 siblings, 0 replies; 7+ messages in thread
From: Bruno Victal @ 2023-01-25 16:37 UTC (permalink / raw)
  To: 59747; +Cc: Bruno Victal

* gnu/services/configuration.scm (alist?): simplify procedure.
---
 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?))
 
 (define serialize-file-like empty-serializer)
 

base-commit: 0d713e0140f4c4a80de6cbfc58fae17cb69beb98
-- 
2.38.1





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#59747] [PATCH v3] services: configuration: simplify alist? procedure.
  2022-12-01 18:09 [bug#59747] [PATCH] services: configuration: rework alist? procedure mirai
                   ` (2 preceding siblings ...)
  2023-01-25 16:37 ` [bug#59747] [PATCH] services: configuration: simplify " Bruno Victal
@ 2023-01-25 16:38 ` Bruno Victal
  2023-02-18  2:31   ` Bruno Victal
  2023-03-21 13:52   ` bug#59747: [PATCH] services: configuration: rework " Maxim Cournoyer
  3 siblings, 2 replies; 7+ messages in thread
From: Bruno Victal @ 2023-01-25 16:38 UTC (permalink / raw)
  To: 59747; +Cc: Bruno Victal

* 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?))
 
 (define serialize-file-like empty-serializer)
 

base-commit: 0d713e0140f4c4a80de6cbfc58fae17cb69beb98
-- 
2.38.1





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#59747] [PATCH v3] services: configuration: simplify alist? procedure.
  2023-01-25 16:38 ` [bug#59747] [PATCH v3] " Bruno Victal
@ 2023-02-18  2:31   ` Bruno Victal
  2023-03-21 13:52   ` bug#59747: [PATCH] services: configuration: rework " Maxim Cournoyer
  1 sibling, 0 replies; 7+ messages in thread
From: Bruno Victal @ 2023-02-18  2:31 UTC (permalink / raw)
  To: 59747

bump




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#59747: [PATCH] services: configuration: rework alist? procedure
  2023-01-25 16:38 ` [bug#59747] [PATCH v3] " Bruno Victal
  2023-02-18  2:31   ` Bruno Victal
@ 2023-03-21 13:52   ` Maxim Cournoyer
  1 sibling, 0 replies; 7+ messages in thread
From: Maxim Cournoyer @ 2023-03-21 13:52 UTC (permalink / raw)
  To: Bruno Victal; +Cc: 59747-done

Hi,

Bruno Victal <mirai@makinata.eu> 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




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-03-21 13:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-01 18:09 [bug#59747] [PATCH] services: configuration: rework alist? procedure mirai
2022-12-08 11:59 ` bug#59747: " Ludovic Courtès
2022-12-08 12:07 ` [bug#59747] [PATCH v2] " mirai
2023-01-25 16:37 ` [bug#59747] [PATCH] services: configuration: simplify " Bruno Victal
2023-01-25 16:38 ` [bug#59747] [PATCH v3] " Bruno Victal
2023-02-18  2:31   ` Bruno Victal
2023-03-21 13:52   ` bug#59747: [PATCH] services: configuration: rework " Maxim Cournoyer

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.