Computer Science 3675
Fall 2003
Practice questions for quiz 3

  1. What is the purpose of the static link in a frame in the run-time stack?

  2. What is the purpose of the dynamic link in a frame in the run-time stack?

  3. What information is stored in a function closure?

  4. In C, you are not allowed to write a function inside another function. But C does allow you to treat a function as a value. Does C need to use function closures?

  5. Explain the purpose of a dereference operation in the semantics of an imperative language.

  6. If, in a C++ program, you write

      int x;
    
    then what kind of thing is the lvalue of x? What kind of thing is the rvalue of x?

  7. Are backtracking and exception handling the same thing? For example, can you use the exception handling mechanism of Java to do backtracking?

  8. What is one important motivation for including exception handling in a programming language?

  9. Using backtracking, write an Astarte program fragment that will print all solutions (x,y) to equation xy - 2x2 + y = 10, where x and y are both integers in the range 0,...,100. Do not use a loop or recursion. Your program fragment can fail when it is done.