Concepts of Programming Languages

(Sean Pound) #1
Problem Set 667

PROBLEM SET



  1. What did the designers of C get in return for not requiring subscript
    range checking?

  2. Describe three approaches to exception handling in languages that do
    not provide direct support for it.

  3. 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.

  4. From ARM (1995), determine how exceptions that take place during
    rendezvous are handled.

  5. From a textbook on COBOL, determine how exception handling is done
    in COBOL programs.

  6. 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?

  7. 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?

  8. Compare the methods suggested in Problems 6 and 7. Which do you
    think is better and why?

  9. Write a comparative analysis of the throw clause of C++ and the
    throws clause of Java.

  10. 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?

  11. Consider the following C++ skeletal program:


class Big {
int i;
float f;
void fun1() throw int {

...
try {
...
throw i;
...
throw f;
...
}

Free download pdf