Com Sci 221 --- Programming Languages
Assignment #8 --- Winter 1995
Due Friday, 3 March

Last modified: Mon Feb 27 12:36:57 1995

Other versions:


  1. Demonstrate that Scheme uses static scope by running a program that would produce different results under dynamic and static scope rules. Example 11.1 on pp. 407 of the text shows how to accomplish this_you may merely program this example carefully in Scheme. Do a hand calculation for the same program from McCarthy's equations for the eval function to show that the original LISP has dynamic scope.
  2. Use stream operations in Scheme to compute the stream hamming described in problem 9.5 on p. 376 of the text. The stream operations that you need are cons-stream, stream-car, and stream-cdr (these are called qcons, head, and tail in the text). Discuss the difference between your stream-oriented program for the Hamming sequence and the sort of program that you would have written in a language without streams.

Comments