mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
guix: records: Add wrap-element procedure.
* guix/records.scm (wrap-element): Add procedure. Change-Id: If121c5d856e815776830282a0701a73e5ae2a7e7
This commit is contained in:
parent
d0767b5a23
commit
38ca46212c
1 changed files with 7 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2012-2024 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
|
||||
;;; Copyright © 2024 Lilah Tascheter <lilah@lunabee.space>
|
||||
;;;
|
||||
;;; 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.
|
||||
|
|
Loading…
Reference in a new issue