guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#49671] bug#50914: [PATCH] records: Raise a &fix-hint if a field has


From: Ludovic Courtès
Subject: [bug#49671] bug#50914: [PATCH] records: Raise a &fix-hint if a field has multiple values.
Date: Mon, 04 Oct 2021 16:26:33 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

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’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]