- You can use Throw and Catch to exit functions such as Nest, Fold, FixedPoint, and Scan.
- tag can be any expression.
- tag in Throw[value,tag] is reevaluated every time it is compared to form in Catch[expr,form].
- An error is generated and an unevaluated Throw is returned if there is no appropriate enclosing Catch to catch the Throw.
Examplesopen allclose all
Basic Examples (3)
Generalizations & Extensions (3)
Properties & Relations (1)
Use Check to throw an exception if a message is generated:
Wolfram Research (1988), Throw, Wolfram Language function, https://reference.wolfram.com/language/ref/Throw.html (updated 2020).
Wolfram Language. 1988. "Throw." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/Throw.html.
Wolfram Language. (1988). Throw. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Throw.html