+\ }}}
+
+\ ---- Exceptions ---- {{{
+
+variable nextexception
+1 nextexception !
+: make-exception
+ create nextexception @ ,
+ 1 nextexception +!
+ does> @ ;
+
+make-exception recoverable-exception
+make-exception unrecoverable-exception
+
+: display-exception-msg ( addr count -- )
+ bold fg red
+ ." Exception: "
+ type
+ reset-term ;
+
+: throw" immediate
+ [compile] s"
+
+ ['] rot , ['] dup ,
+
+ [compile] if
+ ['] -rot ,
+ ['] display-exception-msg ,
+ [compile] then
+
+ ['] throw ,
+;
+
+\ }}}
+