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,ad62d6b425bebfec X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: "use" clauses and Ada 95 OOP Date: 1996/07/23 Message-ID: #1/1 X-Deja-AN: 169710902 references: organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-07-23T00:00:00+00:00 List-Id: In article , Mitch Gart wrote: >But my point is that a naive Ada 95 reader might think that the call > > pkg1.func(x) > >calls the code that is in the body of pkg1. ... >In Ada 83 if a reader sees the call > > pkg1.func > >he can look at the body of pkg1 to see what statements will be executed. But Mitch, Ada 83 doesn't have dispatching, so this isn't a fair comparison. In Ada 83, no matter what you write, you can tell (statically) what body gets called (though if there are use_clauses the analysis might be harder). If you don't like the idea that the body being called is unknown until run-time, then you simply don't like OOP. It's not a syntactic matter. Similarly, in C++, a naive user might think "x.func" calls the func in the class of x. The non-naive user knows that you have to look and see if func is virtual, and if so, there's a run-time dispatch. Both languages are similar in this regard -- some calls jump to a particular place, and some jump to a run-time-known place. And you can't tell without looking at the declaration of the function being called. And in both languages, you have to understand the rules in order to know which is which. I must admit that a person who says "use_clauses are evil but dispatching is good" is being a bit inconsistent. Both use_clauses and dispatching introduce some uncertainty (and flexibility). - Bob