From: "Ludovic Courtès" <ludo@gnu.org>
To: Maxime Devos <maximedevos@telenet.be>
Cc: 49671@debbugs.gnu.org, 50914@debbugs.gnu.org
Subject: [bug#50914] [PATCH] records: Raise a &fix-hint if a field has multiple values.
Date: Mon, 04 Oct 2021 16:26:33 +0200 [thread overview]
Message-ID: <87r1d0ooh2.fsf@gnu.org> (raw)
In-Reply-To: <20210930093229.4730-1-maximedevos@telenet.be> (Maxime Devos's message of "Thu, 30 Sep 2021 11:32:29 +0200")
Hi,
Maxime Devos <maximedevos@telenet.be> skribis:
> * guix/records.scm (report-invalid-field-specifier): If
> 'weird' is something like (field (record ...) extra ...), hint that 'extra
> ...' should probably be moved inside (record ...).
Please see also <https://issues.guix.gnu.org/49671>.
> + (condition
> + (&origin (origin name))
> + (&message (message
> + (format #f "field ‘~a’ should only have one \
> +value, but an extra value ‘~a’ was passed as well. Perhaps this extra \
> +value was supposed to be a field specifier, and needs to be moved inside \
> +the record ‘~a’?"
We’ll need i18n here and straight quotes.
> + (&syntax (form (car forms))
> + (subform (and (not (null? (cdr forms)))
> + (cadr forms))))
No cadrcdr please. :-)
> + (&fix-hint (hint (object->string
> + (syntax->datum
> + #'(field
> + (record-name fields ... extra-value
> + extra-value* ...)))))))))
The ‘hint’ field must be a string, typically the message you had above;
see other examples in the code.
TIA!
Ludo’.
next prev parent reply other threads:[~2021-10-04 14:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-30 9:32 [bug#50914] [PATCH] records: Raise a &fix-hint if a field has multiple values Maxime Devos
2021-10-04 14:26 ` Ludovic Courtès [this message]
2021-10-05 2:02 ` Jack Hill
2021-10-05 4:06 ` Jack Hill
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r1d0ooh2.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=49671@debbugs.gnu.org \
--cc=50914@debbugs.gnu.org \
--cc=maximedevos@telenet.be \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).