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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7508aa0d80b8bf66 X-Google-Attributes: gid103376,public From: Brian Rogoff Subject: Re: Inheritance and Polymorphism in Ada !! Date: 1999/10/24 Message-ID: #1/1 X-Deja-AN: 540003038 References: <7u64k3$l1d$1@hiline.shinbiro.com> <3806DC34.1513E8B1@frqnet.de> <7u7o36$tv8$1@nntp6.atl.mindspring.net> <38077b65_1@news1.prserv.net> <7udtav$ma4$1@nnrp1.deja.com> <7uqvb1$2m4$1@nntp3.atl.mindspring.net> <7uuvth$9n2$1@nnrp1.deja.com> Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: nntp1.ba.best.com 940786420 207 bpr@206.184.139.136 MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-10-24T00:00:00+00:00 List-Id: On Sun, 24 Oct 1999, Robert Dewar wrote: > In article <7uqvb1$2m4$1@nntp3.atl.mindspring.net>, > Richard D Riehle 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