Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » error handling » throw
next | previous | forward | backward | up | index | toc

throw -- throw and catch exceptions

Description

i1 : catch scan(0..10, i -> if i == 5 then throw 18 else print i)
0
1
2
3
4

o1 = 18

For the programmer

The object throw is a keyword.


The source of this document is in /build/reproducible-path/macaulay2-1.25.05+ds/M2/Macaulay2/packages/Macaulay2Doc/ov_language.m2:598:0.