NB It is crucial that the predicate remains a quosure—it must remember its original scope.
As such, the error message won't be properly interpreted by the current implementation of err_invalid_input(), because that function relies on the flag dot_as_expr which is set by parse_check(), and is invisible in the output, above.
Consequently, the mechanism by which the proper scope of dot-interpolation is identified will need to be adapted to the above behavior of localize().
Solution 1: One possibility would be substitute the function of the boolean flag dot_as_expr with a special (prefix/suffix) “marker” in the error message, which is interpreted by err_invalid_input().
Solution 2: Alternatively, a simpler, but arguably more “hacky,” approach would be endow localized checkers with an additional “global name” attribute that would be interpreted by parse_check() as overriding the value of the argument msg. In this case, it would suffice for chkrs to behave accordingly:
This issue refers to the development branch.
Example:
should produce the list of two functions such that
NB It is crucial that the predicate remains a quosure—it must remember its original scope.
As such, the error message won't be properly interpreted by the current implementation of
err_invalid_input()
, because that function relies on the flagdot_as_expr
which is set byparse_check()
, and is invisible in the output, above.Consequently, the mechanism by which the proper scope of dot-interpolation is identified will need to be adapted to the above behavior of
localize()
.Solution 1: One possibility would be substitute the function of the boolean flag
dot_as_expr
with a special (prefix/suffix) “marker” in the error message, which is interpreted byerr_invalid_input()
.Solution 2: Alternatively, a simpler, but arguably more “hacky,” approach would be endow localized checkers with an additional “global name” attribute that would be interpreted by
parse_check()
as overriding the value of the argumentmsg
. In this case, it would suffice forchkrs
to behave accordingly:No change would then be required elsewhere, and the logic of
localize()
would be simplified as well, for it would not require any naming logic.