This commit is contained in:
Ingy döt Net 2013-04-10 21:29:02 -07:00
parent 764da6cbbb
commit db842d013d
19005 changed files with 197040 additions and 7 deletions

View file

@ -0,0 +1,4 @@
"Install Linux, Problem Solved" throw
TUPLE: velociraptor ;
\ velociraptor new throw

View file

@ -0,0 +1,2 @@
ERROR: velociraptor ;
velociraptor

View 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