Com S 541 -- Programming Languages I Feb. 10, 1993 HOMEWORK 5: Values (CP, Chapter 3) Due: February 12, 1993 (extra credit due Feb. 17) Do ONE (1) of the following: (a) Write a proposal for adding flexible arrays to C, C++, Pascal, Modula-2, Ada, Scheme, or LISP. Give any necessary syntax changes. Describe (in English) whatever operations will be built-in to the language to manipulate such arrays. (For example, you may want an operation to add one or more elements to an end of the array.) You need only consider one-dimensional arrays. (b) Read Section 4.2 of the paper "Abstraction Mechanisms in CLU", by Barbara Liskov and Alan Snyder and Russell Atkinson and Craig Schaffert, (CACM, 1977, Volume 20, Number 8, Month Aug, Pages 564-576). Write a review of the iteration mechanism in CLU, and compare it to the for loop of Pascal, (or Ada or C or C++). (c) Aliasing makes programs more difficult to reason about (prove correct). Discuss the effects of abolishing aliasing from a language like C, C++, or Pascal on programming. Sketch a proposal for how the language would abolish aliasing that would have acceptable run-time efficiency. (d) Exercise 3.6 on page 64. (e) Exercise 3.7. (f) Read about variables in Algol-68 or Standard ML from a book or paper. Discuss the similarities and differences between the Algol-68 variables and the SML variables. EXTRA CREDIT (g) Do one some of the other problems. (h) Do problem 3.8. (i) Read about the language Euclid and its solution to problem 3.13. Read about the language FX and its solution to that problem. Which do you think is best and why? (See David K. Gifford and Pierre Jouvelot and John M. Lucassen and Mark A. Sheldon, "FX-87 Reference Manual", MIT LCS Tech Report, (Sept, 1987, TR-407) and also David K. Gifford and John M. Lucassen, "Integrating Functional and Imperative Programming" in "ACM Conference on LISP and Functional Programming", 1986, Pages 28-38.)