|
SOLUTIONS
|
BUILT-IN MATHEMATICA SYMBOL
$AssertFunction
$AssertFunction
specifies a function to apply to assertions that fail.
DetailsDetails
- $AssertFunction is applied to Assert[test, ...] when test is evaluated and found not to be True.
ExamplesExamplesopen allclose all
Basic Examples (1)Basic Examples (1)
You can change the behavior when an assertion fails by assigning to $AssertFunction. This function throws an exception when an assertion fails:
| In[1]:= |
| In[2]:= |
Here the exception thrown by the assertion function is caught:
| In[3]:= |
| Out[3]= |
| In[4]:= |
New in 8
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
