unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#63115: match-record cryptic error message on unbound record type
@ 2023-04-27 14:27 Maxim Cournoyer
  2023-04-27 22:10 ` paren--- via Bug reports for GNU Guix
  0 siblings, 1 reply; 3+ messages in thread
From: Maxim Cournoyer @ 2023-04-27 14:27 UTC (permalink / raw)
  To: 63115; +Cc: Ludovic Courtès

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#63115: match-record cryptic error message on unbound record type
  2023-04-27 14:27 bug#63115: match-record cryptic error message on unbound record type Maxim Cournoyer
@ 2023-04-27 22:10 ` paren--- via Bug reports for GNU Guix
  2023-10-10  3:45   ` Maxim Cournoyer
  0 siblings, 1 reply; 3+ messages in thread
From: paren--- via Bug reports for GNU Guix @ 2023-04-27 22:10 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: ludo, 63115

Maxim Cournoyer <maxim.cournoyer@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>.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#63115: match-record cryptic error message on unbound record type
  2023-04-27 22:10 ` paren--- via Bug reports for GNU Guix
@ 2023-10-10  3:45   ` Maxim Cournoyer
  0 siblings, 0 replies; 3+ messages in thread
From: Maxim Cournoyer @ 2023-10-10  3:45 UTC (permalink / raw)
  To: (; +Cc: 63115-done, ludo

Hello,

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

> Maxim Cournoyer <maxim.cournoyer@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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-10  3:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-27 14:27 bug#63115: match-record cryptic error message on unbound record type Maxim Cournoyer
2023-04-27 22:10 ` paren--- via Bug reports for GNU Guix
2023-10-10  3:45   ` Maxim Cournoyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).