Homework 4
CS 3411 - Programming Language Concepts - Fall '98
Due: 1:30pm Tuesday 1 December (Follow
handin instructions on the class Web page.)
Got Questions? Try office hours, email or the class
newsgroup.
Complete the following Problems from Chapter 7 Subprogram
Control of your textbook:
-
Problem 1 page 345
-
Problem 6 page 346
-
Problem 10 pages 346-347
-
Problem 12 pages 347-348
-
Problem 16 pages 348-349
-
Pascal has compound statements that allow grouping
of statement sequences. C extends this idea to allow variable declarations
at the beginning of compound statements which are called blocks.
One way to implement block allocation (declaration of local variables with
block scope) is to treat each block as a parameterless procedure and create
an activation record (stack frame) for each block. This is very expensive
and rarely done because there is an important difference between blocks
and parameterless procedures that allows a more efficient implementation.
What is the difference? Describe a more efficient implementation.