Topic: control returning functions and expressions
Topic: failure returning functions and expressions
Topic: lattice theory of types
Topic: undefined, null, and other signal values
| |
Summary
In expression oriented languages exceptions can be seen as a unique value (e.g., 'nil') which is returned when an exception occurs. Any operation using an exception value then returns the exception value. Exception values are the same as undefined values of partial functions, or non-terminating functions. They generalize functions to the universal type domain and provide a partial ordering for Scott's lattice theory. (cbb 5/80)
Subtopic: error values
Quote: use error values to tell users of an operation that an error occurred [»ackeWB_1979]
| Subtopic: nil/bottom value
Quote: a functional program for matrix multiply yields .bottom. for inappropriate arguments; it is perfectly general [»backJ8_1978a]
| Quote: in arithmetic can use +-infinity as NIL; so uninitialized variables produce NIL results [»wileDS11_1973, OK]
| Quote: all functions in an FP system map objects into objects; bottom-preserving, f.bottom. = .bottom. [»backJ8_1978a]
| Subtopic: avoid error values
Quote: problems with error handling by return code and status flags; checked at call sites; harder to read; multiple error cases ignored; harder to modify; expands set of legal values [»buhrPA9_2000]
| Quote: throw and catch separates error handling code from ordinary code; error handling is more regular than with error values or error call-backs
| Quote: exceptions promote API consistency; designed for failure reporting and nothing else; while return values have many uses, e.g., Win32 API [»cwalK_2006]
| Quote: if using return values, error handling code must be near the code that could fail [»cwalK_2006]
|
Related Topics
Topic: control returning functions and expressions (6 items)
Topic: failure returning functions and expressions (24 items)
Topic: lattice theory of types (15 items)
Topic: undefined, null, and other signal values (34 items)
|