1.10 Configuring Error Reporting
(require syntax/parse/report-config) | package: base |
Added in version 8.9.0.5 of package base.
parameter
(current-report-configuration config) → void? config : report-configuration?
A configuration is a hash table with the following keys:
'datum-to-what —
a procedure of one argument used to get a noun describing an expected datum, which appears in a pattern either with ~datum, as “self-quoting,” or so on. The procedure’s argument is the datum value. The result must be either a string or a list containing two strings; if two strings are provided, the first is used when a singular noun is needed, and the second is used as a plural noun. The default configuration returns '("literal symbol" "literal symbols") for a symbol and '("literal" "literals") for any other datum value.
'datum-to-string —
a procedure of one argument, used to convert the datum value to a string that is included in the error message. The procedure’s argument is the datum value, and the result must be a string. The default configuration formats a symbol value using (format "`~s'" v) any other datum value using (format "~s" v).
'literal-to-what —
a procedure of one argument used to get a noun describing an expected literal identifier, which appears in a pattern with ~literal, as declared with #:literals, or so on. The procedure’s argument is an identifier when available, or a symbol when only simplified information has been preserved. The result must be either a string or a list containing two strings, like the result for a 'datum-to-what procedure. The default configuration returns '("identifier" "identifiers").
'literal-to-string —
a procedure of one argument, used to convert a literal identifier or symbol to a string that is included in the error message. The default configuration formats a symbol value using (format "`~s'" v), and it formats an identifier the same after extracting its symbol with syntax-e.
procedure
v : any/c