records: Slight simplification.

* guix/records.scm (make-syntactic-constructor): Simplify 'find' expression.
This commit is contained in:
Ludovic Courtès 2017-04-16 17:25:11 +02:00
parent f11ae44fa1
commit 94df39cc08
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 4 additions and 5 deletions

View File

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU ;;; 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. ;;; This file is part of GNU Guix.
;;; ;;;
@ -134,10 +134,9 @@ fields, and DELAYED is the list of identifiers of delayed fields."
((_ (field value) (... ...)) ((_ (field value) (... ...))
(let ((fields (map syntax->datum #'(field (... ...))))) (let ((fields (map syntax->datum #'(field (... ...)))))
(define (field-value f) (define (field-value f)
(or (and=> (find (lambda (x) (or (find (lambda (x)
(eq? f (car (syntax->datum x)))) (eq? f (syntax->datum x)))
#'((field value) (... ...))) #'(field (... ...)))
car)
(wrap-field-value f (field-default-value f)))) (wrap-field-value f (field-default-value f))))
(let ((fields (append fields (map car default-values)))) (let ((fields (append fields (map car default-values))))