Problem Set 667
PROBLEM SET
- What did the designers of C get in return for not requiring subscript
range checking? - Describe three approaches to exception handling in languages that do
not provide direct support for it. - From textbooks on the PL/I and Ada programming languages, look up
the respective sets of built-in exceptions. Do a comparative evaluation of
the two, considering both completeness and flexibility. - From ARM (1995), determine how exceptions that take place during
rendezvous are handled. - From a textbook on COBOL, determine how exception handling is done
in COBOL programs. - In languages without exception-handling facilities, it is common to have
most subprograms include an “error” parameter, which can be set to
some value representing “OK” or some other value representing “error
in procedure.” What advantage does a linguistic exception-handling
facility like that of Ada have over this method? - In a language without exception-handling facilities, we could send an
error-handling procedure as a parameter to each procedure that can
detect errors that must be handled. What disadvantages are there to this
method? - Compare the methods suggested in Problems 6 and 7. Which do you
think is better and why? - Write a comparative analysis of the throw clause of C++ and the
throws clause of Java. - Compare the exception-handling facilities of C++ with those of Ada.
Which design, in your opinion, is the most flexible? Which makes it pos-
sible to write more reliable programs? - Consider the following C++ skeletal program:
class Big {
int i;
float f;
void fun1() throw int {
...
try {
...
throw i;
...
throw f;
...
}