Handling Errors and Exceptions
Runtime errors are inevitable in real-world programs. The signals from the real world (keystrokes, mouse events, network packets, sounds of speech, and videos, to name a few) are often unpredictable, untimely, noisy, and inconsistent. To build dependable software, you should anticipate their imperfect nature and write code that can handle errors. Forth assists this noble goal by providing two levels of error handling.
he “higher-level” commands aim to bring the unruly program under control by returning to the command line interpreter. The higher-level commands are ABORT, ABORT" (yes, with a quotation mark as a part of the word), and QUIT.
-
The word ABORT stops the execution of the enclosing word, empties both ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access