comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@shell5.ba.best.com>
Subject: Re: Inheritance and Polymorphism in Ada !!
Date: 1999/10/24
Date: 1999-10-24T00:00:00+00:00	[thread overview]
Message-ID: <Pine.BSF.4.10.9910241023300.2856-100000@shell5.ba.best.com> (raw)
In-Reply-To: 7uuvth$9n2$1@nnrp1.deja.com

On Sun, 24 Oct 1999, Robert Dewar wrote:
> In article <7uqvb1$2m4$1@nntp3.atl.mindspring.net>,
>   Richard D Riehle <laoXhai@ix.netcom.com> wrote:
> 
> > I remembered reading a short discussion of the Algol
> > equivalent of declare blocks in Dijkstra's oldie but goodie,
> > A Discipline of Computer Programming.  So I pulled my
> > dog-eared copy from a nearby bookshelf to re-read it.
> > Read chapter 10 for a well-reasoned criticism of this notion.
> >
> > Not very much has changed in the Ada declare block.  All the
> > same problems exist that we had with Algol. It is quite
> > wonderful that we are still arguing the same issues that we
> > were arguing about in 1976 when Dijkstra's book was published.
> 
> Yes, indeed, this is an old argument :-)
> 
> My feeling is that people do not use declare blocks NEARLY
> often enough. In a language like C or Ada (unlike say COBOL
> which has a light syntax for local procedures, sorry, can't
> help getting in that dig :-) it is impractical to introduce
> a new procedure every time we have a local variable. For
> example, if we say
> 
>   t := a;
>   a := b;
>   b := t;

In Python 

	a,b = b,a

Far more readable to me than anything C or Ada has to offer. Sorry, I
couldn't resist either!

> And then of course in Ada, the paradigm:
> 
>    read (N);
>    declare
>       x : matrix (1 .. N, 1 .. N);
>    ...
> 
> is very valuable. I really think the notion of declare blocks
> is a very important one. Algol-60 of course had both nested
> procedures and nested blocks. It is interesting that there
> have been three threads of development of these ideas:
> 
> Omit nested procedures, keep nested blocks (C, C++)
> Omit nested blocks, keep nested procedures (Pascal)
> Keep both (PL/1, Ada)
> 
> I far prefer the third approach.

Agreed.

> Note that the issue of heaviness of syntax (and whether you
> need a marker between declarations and statements, which is
> the point Bob Duff has made) is quite orthogonal to the
> fundamental point that nested blocks are very valuable.

I think Bob Duff's point was a good one. The renaming syntax is heavy.
That's part of the reason someone suggested alternate devices for 
places where renaming might be used. 

-- Brian






  reply	other threads:[~1999-10-24  0:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-15  0:00 Inheritance and Polymorphism in Ada !! Chango Cho
1999-10-15  0:00 ` Andreas Winckler
1999-10-15  0:00   ` Lutz Donnerhacke
1999-10-15  0:00   ` Richard D Riehle
1999-10-15  0:00     ` Matthew Heaney
1999-10-15  0:00       ` Richard D Riehle
1999-10-18  0:00       ` Robert Dewar
1999-10-23  0:00         ` Richard D Riehle
1999-10-24  0:00           ` Robert Dewar
1999-10-24  0:00             ` Brian Rogoff [this message]
1999-10-26  0:00               ` Robert Dewar
1999-10-25  0:00             ` Robert A Duff
1999-10-26  0:00               ` Robert Dewar
1999-10-26  0:00                 ` Robert A Duff
1999-10-18  0:00       ` Robert A Duff
1999-10-19  0:00         ` Robert Dewar
1999-10-20  0:00           ` Robert A Duff
1999-10-21  0:00             ` Simon Wright
1999-10-21  0:00               ` Robert A Duff
1999-10-21  0:00             ` Paul Duquennoy
1999-10-21  0:00             ` Robert Dewar
1999-10-22  0:00         ` Matthew Heaney
1999-10-15  0:00   ` Stephane Barbey
1999-10-15  0:00   ` tmoran
1999-10-15  0:00     ` tmoran
1999-10-15  0:00   ` Matthew Heaney
1999-10-18  0:00     ` Robert A Duff
1999-10-18  0:00       ` Brian Rogoff
1999-10-18  0:00   ` Robert A Duff
1999-10-15  0:00 ` Ted Dennison
1999-10-15  0:00 ` Lutz Donnerhacke
replies disabled

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