guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/03: records: Use SRFI-11 instead of SRFI-71, for Guile 2.0 compatibil


From: guix-commits
Subject: 02/03: records: Use SRFI-11 instead of SRFI-71, for Guile 2.0 compatibility.
Date: Tue, 6 Jun 2023 05:56:14 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit dc0c5d56ee04d8a2b57f316be7f95b9aca244ab5
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Tue Jun 6 09:06:59 2023 +0200

    records: Use SRFI-11 instead of SRFI-71, for Guile 2.0 compatibility.
    
    This fixes a failure of 'tests/packages.scm' introduced in
    b88e38d4b51b9aa0e857baeb614c000e491ad309: some of the tests import (guix
    records) on the build side, which uses '%bootstrap-guile' (Guile 2.0)
    where SRFI-71 is unavailable.
    
    * guix/records.scm (match-record-inner): Use SRFI-11 instead of SRFI-71.
---
 guix/records.scm | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/guix/records.scm b/guix/records.scm
index 6c9f29eb3e..5af3e780a0 100644
--- a/guix/records.scm
+++ b/guix/records.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012-2022 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012-2023 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -20,8 +20,8 @@
 (define-module (guix records)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-9)
+  #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-26)
-  #:use-module (srfi srfi-71)
   #:use-module (ice-9 match)
   #:use-module (ice-9 rdelim)
   #:autoload (system base target) (target-most-positive-fixnum)
@@ -622,9 +622,11 @@ to thunked values.  Raise a syntax violation when the 
field is not found."
                        (syntax-rules ()
                         ((_ f)
                           (lookup-field+wrapper record field 0 f)))))
-           (let* ((offset wrap (type (map-fields type match-record)
-                                     field-offset+wrapper))
-                  (variable (wrap (struct-ref record offset))))
+           (let*-values (((offset wrap)
+                          (type (map-fields type match-record)
+                                field-offset+wrapper))
+                         ((variable)
+                          (wrap (struct-ref record offset))))
              (match-record-inner record type (rest ...) body ...))))
       ((_ record type (field rest ...) body ...)
        ;; Redirect to the canonical form above.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]