~ruther/guix-local

59910f1834f5e6a52466d1583e4bc9a239c92a6d — Ludovic Courtès 4 months ago 924bf42
records: ‘match-record’ throws a well-formed ’wrong-type-arg’ exception.

* guix/records.scm (match-record): Produce a well-formed ‘wrong-type-arg’
exception.

Change-Id: I5bc16320326446baee15ff16bb7859469c97ac1d
1 files changed, 4 insertions(+), 2 deletions(-)

M guix/records.scm
M guix/records.scm => guix/records.scm +4 -2
@@ 1,5 1,5 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012-2024 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2012-2025 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
;;;
;;; This file is part of GNU Guix.


@@ 671,7 671,9 @@ an unknown field is queried."
    ((_ record type (fields ...) body ...)
     (if (eq? (struct-vtable record) type)
         (match-record-inner record type (fields ...) body ...)
         (throw 'wrong-type-arg record)))))
         (throw 'wrong-type-arg "match-record"
                "Wrong type (expecting a ~a record): ~S"
                (list 'type record) (list record))))))

(define-syntax match-record-lambda
  (syntax-rules ()