Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!nrl-cmf!mailrus!tut.cis.ohio-state.edu!bloom-beacon!athena.mit.edu!peter From: peter@athena.mit.edu (Peter J Desnoyers) Newsgroups: comp.lang.misc Subject: Re: From Modula to Oberon Message-ID: <3864@bloom-beacon.MIT.EDU> Date: 18 Mar 88 05:20:40 GMT References: <2827@enea.se> <1557@pasteur.Berkeley.Edu> <3764@bloom-beacon.MIT.EDU> <1130@PT.CS.CMU.EDU> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: peter@athena.mit.edu (Peter J Desnoyers) Organization: Massachusetts Institute of Technology Lines: 30 Keywords: iteration, In article <1130@PT.CS.CMU.EDU> edw@IUS1.CS.CMU.EDU (Eddie Wyatt) writes: > ***This is not a flame against the author.*** > When will people learn, data abstraction is not a programming >language or type of programming language, it is a programming >methodology. > In particular if you want generalized iteration say in C, its >a simple matter of defining an iteration function for that ... > >Eddie Wyatt e-mail: edw@ius1.cs.cmu.edu Data abstraction is __assisted__ by the proper choice of programming language. Note that the `for' construct in Pascal is not powerful enough to build such a general-purpose iterator - you would have to do it with the more general `while' construct. Similarly, C does not provide direct language support for co-routines, and constructing an iterator that yields members of a recursive structure requires constructing an explicit static stack. (Similar to expressing a recursive routine in a non-recursive Basic) Try writing an iteration function in C for a binary tree. That may be data abstraction, but when you get done with it, it's going to look ugly because __C is not powerful enough to express general iterators cleanly__. I hope that I did not flame too much - it's late at night, and I wanted to clarify my previous comments. Peter Desnoyers peter@athena.mit.edu