mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 15:36:20 -05:00
records: Slight simplification.
* guix/records.scm (make-syntactic-constructor): Simplify 'find' expression.
This commit is contained in:
parent
f11ae44fa1
commit
94df39cc08
1 changed files with 4 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
|
@ -134,10 +134,9 @@ (define (field-bindings field+value)
|
|||
((_ (field value) (... ...))
|
||||
(let ((fields (map syntax->datum #'(field (... ...)))))
|
||||
(define (field-value f)
|
||||
(or (and=> (find (lambda (x)
|
||||
(eq? f (car (syntax->datum x))))
|
||||
#'((field value) (... ...)))
|
||||
car)
|
||||
(or (find (lambda (x)
|
||||
(eq? f (syntax->datum x)))
|
||||
#'(field (... ...)))
|
||||
(wrap-field-value f (field-default-value f))))
|
||||
|
||||
(let ((fields (append fields (map car default-values))))
|
||||
|
|
Loading…
Reference in a new issue