Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
4
Task/Exceptions/Factor/exceptions-1.factor
Normal file
4
Task/Exceptions/Factor/exceptions-1.factor
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
"Install Linux, Problem Solved" throw
|
||||
|
||||
TUPLE: velociraptor ;
|
||||
\ velociraptor new throw
|
||||
2
Task/Exceptions/Factor/exceptions-2.factor
Normal file
2
Task/Exceptions/Factor/exceptions-2.factor
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
ERROR: velociraptor ;
|
||||
velociraptor
|
||||
12
Task/Exceptions/Factor/exceptions-3.factor
Normal file
12
Task/Exceptions/Factor/exceptions-3.factor
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
! Preferred exception handling
|
||||
: try-foo
|
||||
[ foo ] [ foo-failed ] recover ;
|
||||
|
||||
: try-bar
|
||||
[ bar ] [ bar-errored ] [ bar-always ] cleanup ;
|
||||
|
||||
! Used rarely
|
||||
[ "Fail" throw ] try ! throws a "Fail"
|
||||
[ "Fail" throw ] catch ! returns "Fail"
|
||||
[ "Hi" print ] catch ! returns f (looks the same as throwing f; don't throw f)
|
||||
[ f throw ] catch ! returns f, bad! use recover or cleanup instead
|
||||
Loading…
Add table
Add a link
Reference in a new issue