apply
; make-primitive apply
+
+( ==== Error System ==== )
+
+:noname ( args -- result )
+ bold fg red
+
+ nil? if
+ ." Error."
+ else
+ ." Error: " car display
+ then
+
+ reset-term
+
+ recoverable-exception throw
+; make-primitive error
make-exception recoverable-exception
make-exception unrecoverable-exception
-: display-warning ( addr count -- )
+: display-exception-msg ( addr count -- )
bold fg red
." Exception: "
type
[compile] if
['] -rot ,
- ['] display-warning ,
+ ['] display-exception-msg ,
[compile] then
['] throw ,
recoverable-exception of false endof
unrecoverable-exception of true endof
- \ Rethrow anything else:
- throw
-
- \ If we're still here, loop again
- false
+ throw false
endcase
until
;