Subject: [PATCH v3 07/14] guix: records: Add wrap-element procedure.

From: Herman Rimm <[email-masked]>
Date: Thu, 26 Sep 2024 12:09:04 +0200

* guix/records.scm (wrap-element): Add procedure.

Change-Id: If121c5d856e815776830282a0701a73e5ae2a7e7
---
 guix/records.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/guix/records.scm b/guix/records.scm
index c084441441..b521a59257 100644
--- a/guix/records.scm
+++ b/guix/records.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012-2024 Ludovic Courtès <[email-masked]>
 ;;; Copyright © 2018 Mark H Weaver <[email-masked]>
+;;; Copyright © 2024 Lilah Tascheter <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -31,6 +32,8 @@ (define-module (guix records)
             alist->record
             object->fields
             recutils->alist
+            wrap-element
+
             match-record
             match-record-lambda))
 
@@ -606,6 +609,10 @@ (define (recutils->alist port)
               (else
                (error "unmatched line" line))))))))
 
+(define (wrap-element x)
+  "Sanitize a record field value X to a list."
+  (if (list? x) x (list x)))
+
 
 ;;;
 ;;; Pattern matching.
-- 
2.45.2