Subject: bug#63115: closed (Re: bug#63115: match-record cryptic error message on unbound record type)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 10 Oct 2023 03:46:02 +0000

Your bug report

#63115: match-record cryptic error message on unbound record type

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
63115: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63115
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#63115: match-record cryptic error message on unbound record type
From: Maxim Cournoyer <[email-masked]>
To: "(" <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Mon, 09 Oct 2023 23:45:10 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

"(" <[email-masked]> writes:

> Maxim Cournoyer <[email-masked]> writes:
>> When a record type is not in scope, the error message produced by the
>> match-record macro from (guix records) reads something like:
>>
>> --8<---------------cut here---------------start------------->8---
>> guix/records.scm:598:32: map-fields: bad use of syntactic keyword in subform map-fields of map-fields
>> --8<---------------cut here---------------end--------------->8---
>
> Josselin made a patch, which I adapted and submitted at
> <https://issues.guix.gnu.org/63135>.

Which has since been merged, thank you!  Closing.

-- 
Thanks,
Maxim

Subject: match-record cryptic error message on unbound record type
From: Maxim Cournoyer <[email-masked]>
To: bug-guix <[email-masked]>
Cc: Ludovic Courtès <[email-masked]>
Date: Thu, 27 Apr 2023 10:27:26 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

When a record type is not in scope, the error message produced by the
match-record macro from (guix records) reads something like:

--8<---------------cut here---------------start------------->8---
guix/records.scm:598:32: map-fields: bad use of syntactic keyword in subform map-fields of map-fields
--8<---------------cut here---------------end--------------->8---

It'd be nicer if it could hint the developer what the error is exactly
(unknown record type).

Reproducer:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)>

(use-modules (gnu system accounts)
             (guix records))

(define dummy-account
  (user-account (name "dum") (group "dum")))

(match-record dummy-account <user-account>
  (name)
  name)

While compiling expression:
Syntax error:
guix/records.scm:598:32: map-fields: bad use of syntactic keyword in
subform map-fields of map-fields
--8<---------------cut here---------------end--------------->8---

This was caused by <user-account> not being exported from (gnu system
accounts).

-- 
Thanks,
Maxim