comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Proposed change to BC iterator parameters
Date: 19 Dec 2003 18:05:34 -0500
Date: 2003-12-19T18:05:34-05:00	[thread overview]
Message-ID: <wccwu8sv269.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: mailman.140.1071849240.31149.comp.lang.ada@ada-france.org

"amado.alves" <amado.alves@netcabo.pt> 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



  reply	other threads:[~2003-12-19 23:05 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-19 15:53 Proposed change to BC iterator parameters amado.alves
2003-12-19 23:05 ` Robert A Duff [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-12-23 10:40 amado.alves
2003-12-11 16:02 amado.alves
2003-12-11 15:05 ada_wizard
2003-12-11 16:45 ` Robert A Duff
2003-12-11 12:56 amado.alves
2003-12-17 20:25 ` Robert A Duff
2003-12-11 12:43 amado.alves
2003-12-11 12:33 amado.alves
2003-12-10 14:39 amado.alves
2003-12-10 13:36 amado.alves
2003-12-10 17:39 ` Martin Krischik
2003-12-10 18:22 ` Jeffrey Carter
2003-12-10 23:00   ` Robert A Duff
2003-12-11  1:00     ` Jeffrey Carter
2003-12-11 15:09       ` Robert A Duff
2003-12-11  8:33     ` Dmitry A. Kazakov
2003-12-10 20:50 ` Simon Wright
2003-12-10 23:12 ` Robert A Duff
2003-12-11  5:07   ` Steve
2003-12-11 15:24     ` Robert A Duff
2003-12-11 17:39       ` Jeffrey Carter
2003-12-12 22:22         ` Robert A Duff
2003-12-13  0:57           ` Jeffrey Carter
2003-12-17 20:59             ` Robert A Duff
2003-12-18 10:05               ` Dmitry A. Kazakov
2003-12-18 18:14                 ` Robert A Duff
2003-12-19 10:53                   ` Dmitry A. Kazakov
2003-12-19 16:17                     ` Georg Bauhaus
2003-12-19 17:19                       ` Dmitry A. Kazakov
2003-12-19 22:51                         ` Robert A Duff
2003-12-20 12:20                           ` Dmitry A. Kazakov
2003-12-19 22:47                       ` Robert A Duff
2003-12-20  2:11                         ` Stephen Leake
2003-12-20 19:08                         ` Robert I. Eachus
2003-12-21 11:39                           ` Simon Wright
2003-12-21 18:13                             ` Robert I. Eachus
2003-12-21 13:58                           ` Dmitry A. Kazakov
2003-12-22  1:25                             ` Robert I. Eachus
     [not found]         ` <916oa1-c93.ln1@beastie.ix.netcom.com>
2003-12-13 16:57           ` Simon Wright
2003-12-12  5:29     ` Simon Wright
2003-12-12 22:26       ` Robert A Duff
2003-12-13 16:55         ` Simon Wright
2003-12-13 17:27           ` Dmitry A. Kazakov
2003-12-13  2:44       ` Steve
2003-12-10  5:46 Simon Wright
2003-12-10 18:12 ` Jeffrey Carter
2003-12-11 16:10   ` Martin Krischik
2003-12-10 20:59 ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox