1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 13:10:33 +02:00

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
This commit is contained in:
Ludovic Courtès
2025-09-30 10:43:18 +02:00
parent 924bf42f09
commit 59910f1834

View File

@@ -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 ()