From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fa18fb47ddd229a7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-19 15:05:35 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!chcgil2-snh1.gtei.net!news.bbnplanet.com!nycmny1-snf1.gtei.net!news.gtei.net!colt.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Proposed change to BC iterator parameters Date: 19 Dec 2003 18:05:34 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: pip1-5.std.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1071875134 20283 192.74.137.185 (19 Dec 2003 23:05:34 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 19 Dec 2003 23:05:34 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:3589 Date: 2003-12-19T18:05:34-05:00 List-Id: "amado.alves" writes: > "...Ada has such weak support for iterators." > > Will you stop saying that? Sorry, I thought this newsgroup was for discussing Ada. I didn't realize it was purely a cheerleading-for-Ada club. ;-) > An iterator is an abstraction. No general purpose language is suppose > to have "support for iterators". Ada provides many building blocks > appropriate for constructing iterators. I've nothing against the "building block" approach. The problem is that Ada doesn't have the right building blocks to support iterators. Some general-purpose languages, by the way, *do* have direct support for iterators. CLU and Sather come to mind. Other languages have reasonable building blocks. Lisp and Smalltalk come to mind (although they lose compile-time type checking). Even Pascal has better building blocks (for iterators) than Ada -- Pascal has downward closures. > The only thing lacking is > perhaps anonymous subprograms (e.g. like blocks in Smalltalk). But I > fear adding that would go against a number of the "-ilities". No, that's far from the "only" thing lacking. I mentioned several others in other posts. The main one is downward closures. I don't know of any "-ilities" that anonymous subprograms would necessarily violate; I think that's a FUD argument. Of course, we wouldn't want to do it exactly like Smalltalk, where the parameter types are unknown. The current building blocks violate at least one important "ility": readability. You have to instantiate separately, and you have to split the loop body out into a separate procedure, and you have to pass extra paraameters around, all of which means that the pieces of the loop get scattered about. And you have to clutter the namespace with a name for the loop body, which is not (usually) a natural abstraction on its own, and doesn't deserve a separate name. Or you have to use the "cursor" style, which has problems I pointed out elsewhere. - Bob