confirms that no messages are generated during the evaluation of expr, otherwise quieting them and throwing an error to the nearest surrounding Enclose.
tests only for the specified message.
tests only for the specified list of messages.
tests only for messages in the named message group.
evaluates info and includes its value in the thrown error if expr is not confirmed.
uses the specified tag for any thrown errors.
- ConfirmQuiet[expr,…] returns expr if the evaluation of expr does not generate any specified messages.
- ConfirmQuiet is dynamically scoped when given a tag. Otherwise, it is lexically scoped. »
- The default value of info is Null.
- ConfirmQuiet does not test for messages that have been switched off using Off, or by uses of Quiet that occur inside it.
- The operation of ConfirmQuiet is not affected by being enclosed inside Quiet.
- In ConfirmQuiet[expr,"name"], possible named message groups are given by $MessageGroups.
- ConfirmQuiet stops evaluation when the first matching message is generated. »
- ConfirmQuiet[expr] is equivalent to ConfirmQuiet[expr,All].
- Failure objects generated by ConfirmQuiet include the following fields:
"Information" info from ConfirmQuiet[expr,mspec,info,…] "HeldExpression" Hold[expr] from ConfirmQuiet[expr,…] "HeldMessage" Hold[s::t] for the detected message s::t
- Values of these fields can be extracted using failure["prop"] or directly through Enclose[expr,"prop"].
Examplesopen allclose all
Basic Examples (1)
ConfirmQuiet[expr] gives expr if evaluating expr does not generate any messages:
Evaluation is stopped as soon as a message is generated, and an error is thrown to the surrounding Enclose:
ConfirmQuiet stops evaluation and returns to the matching Enclose when a matching message is generated:
info is only evaluated when expr cannot be confirmed:
Create a function that calls ConfirmQuiet with a tag so that it can be caught dynamically:
If no tag is given, ConfirmQuiet is lexically scoped:
Properties & Relations (2)
Unlike Check, ConfirmQuiet stops evaluation once a message is generated:
ConfirmQuiet does not detect messages suppressed by an inner Quiet:
However, ConfirmQuiet does detect messages suppressed by an outer Quiet:
Possible Issues (3)
ConfirmQuiet must be given a tag or be within a lexical Enclose:
Untagged ConfirmQuiet works by replacing instances of the symbol ConfirmQuiet with a tagged variant:
Tagged ConfirmQuiet requires an Enclose with a matching tag:
Wolfram Research (2020), ConfirmQuiet, Wolfram Language function, https://reference.wolfram.com/language/ref/ConfirmQuiet.html.
Wolfram Language. 2020. "ConfirmQuiet." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ConfirmQuiet.html.
Wolfram Language. (2020). ConfirmQuiet. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ConfirmQuiet.html