GNU bug report logs - #63115
match-record cryptic error message on unbound record type

Previous Next

Package: guix;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Thu, 27 Apr 2023 14:28:01 UTC

Severity: normal

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#63115: closed (match-record cryptic error message on unbound
 record type)
Date: Tue, 10 Oct 2023 03:46:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 09 Oct 2023 23:45:10 -0400
with message-id <87cyxn6szd.fsf <at> gmail.com>
and subject line Re: bug#63115: match-record cryptic error message on unbound record type
has caused the debbugs.gnu.org bug report #63115,
regarding match-record cryptic error message on unbound record type
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
63115: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63115
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: bug-guix <bug-guix <at> gnu.org>
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: match-record cryptic error message on unbound record type
Date: Thu, 27 Apr 2023 10:27:26 -0400
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


[Message part 3 (message/rfc822, inline)]
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: "(" <paren <at> disroot.org>
Cc: 63115-done <at> debbugs.gnu.org, ludo <at> gnu.org
Subject: Re: bug#63115: match-record cryptic error message on unbound record
 type
Date: Mon, 09 Oct 2023 23:45:10 -0400
Hello,

"(" <paren <at> disroot.org> writes:

> Maxim Cournoyer <maxim.cournoyer <at> gmail.com> 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


This bug report was last modified 1 year and 277 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.