This Article 
 Bibliographic References 
 Add to: 
The Effect of Data Abstraction on Loop Programming Techniques
April 1990 (vol. 16 no. 4)
pp. 389-402

It is shown how loop algorithms can be encompassed in an iterator and then activated for any data type for which a generator can be defined. It takes the iterator-generator idea a step further than previous work in that it permits variations of the iterators to be defined dynamically through the use of selectors and actors, without loss of efficiency or clarity. It is further shown that selectors can be employed in the definition of a truly generic sorting routine. Guidelines for the decomposition of a system into generic data types, abstract data types, iterators, generators, and the programs that exercise them are given, and several complete programs show the implementation of the techniques in Ada.

[1] E. Anson, "A generalized iterative construct and its semantics,"ACM Trans. Program. Lang. Syst., vol. 9, no. 4, pp. 567-581, Oct. 1987.
[2] I. Atkinson, "Jumping about and getting into a state,"Comput. J., vol. 27, no. 1, pp. 42-46, Feb. 1984.
[3] J. M. Bishop, "Iterators and generators in Ada," inData Abstraction in Programming Languages. Wokingham, England: Addison-Wesley, 1986, pp. 92-100.
[4] G. Booch,Software Components with Ada. Menlo Park, CA: Benjamin/Prentice-Hall, 1987.
[5] Commun. ACM (ACM Forum), vol. 30, no. 5, pp. 351-355, May 1987; (ACM Forum), vol. 30, no. 6, pp. 475-478, June 1987: (ACM Forum), vol. 30, no. 8, pp. 659-661, Aug. 1987: (Technical Correspondence), vol. 30, no. 11, pp. 980-985, Nov. 1987.
[6] E. W. Dijkstra,A Discipline of Programming. Englewood Cliffs, NJ: Prentice-Hall, 1976.
[7] E. W. Dijkstra, "Goto one more time,"Commun. ACM, vol. 30, no. 8, pp. 661-662, Aug. 1987.
[8] J. D. Eckart, "Iteration and abstract data types,"SIGPLAN, vol. 22, no. 4, pp. 103-110, Apr. 1987.
[9] M. C. Er, "The use of termination indicators in computer programming,"Comput. J., vol. 29, no. 5, pp. 430-433, Oct. 1986.
[10] D. E. Knuth, "Structured programming with GOTO statements,"Comput. Surveys, vol. 6, pp. 261-301, Dec. 1974.
[11] B. Liskovet al., "Abstraction mechanisms in CLU,"Commun. ACM, vol. 20, pp. 564-576, Aug. 1977.
[12] B. Liskov and J. Guttag,Abstraction and Specification in Program Development. Cambridge, MA: MIT Press, 1986.
[13] H. D. Mills and R. C. Linger, "Data structured programming: Program design without arrays and pointers,"IEEE Trans. Software Eng., vol. SE-12, pp. 192-197, Feb. 1986.
[14] D. L. Parnas, "A generalized control structure and its formal definition,"Commun. ACM, vol. 26, no. 8, Aug. 1983, pp. 527-581.
[15] T. W. Pratt, "Control computations and the design of loop control structures,"IEEE Trans. Software Eng., vol. 4, no. 2, pp. 81-89, Feb. 1978.
[16] C. W. Reynolds, "On implementing generic data structures in Modula-2,"J. Pascal, Ada, Mod-2, vol. 6, no. 5, pp. 26-38, Sept. 1987.
[17] F. Rubin, "GOTO considered harmful considered harmful,"Commun. ACM, vol. 30, no. 3, pp. 195-196, Mar. 1987.
[18] F. Rubin, "Last (Gasp!) GOTO,"Commun. ACM, vol. 30, no. 12, p. 997, Dec. 1987.
[19] M. Shaw, W. A. Wulf, and L. London, "Abstraction and verification in Alphard: Defining and specifying iteration and generators."Commun. ACM, vol. 20, pp. 553-564, Aug. 1977.

Index Terms:
data abstraction; loop programming techniques; loop algorithms; iterator; generic sorting routine; generic data types; abstract data types; generators; Ada; data structures; software engineering.
J.M. Bishop, "The Effect of Data Abstraction on Loop Programming Techniques," IEEE Transactions on Software Engineering, vol. 16, no. 4, pp. 389-402, April 1990, doi:10.1109/32.54291
Usage of this product signifies your acceptance of the Terms of Use.