GNU bug report logs -
#50914
[PATCH] records: Raise a &fix-hint if a field has multiple values.
Previous Next
Full log
View this message in rfc822 format
Hi,
Maxime Devos <maximedevos <at> 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’.
This bug report was last modified 3 years and 252 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.