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-Thread: 103376,e8023133274ae02c X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!t31g2000cwb.googlegroups.com!not-for-mail From: "Ludovic Brenta" Newsgroups: comp.lang.ada Subject: Re: procedural vs object oriented Date: 27 Apr 2006 06:20:42 -0700 Organization: http://groups.google.com Message-ID: <1146144042.780839.217550@t31g2000cwb.googlegroups.com> References: <1146039364.130635.181590@v46g2000cwv.googlegroups.com> <871wvjh9te.fsf@ludovic-brenta.org> <1xs8jrwjj0dx2$.1ksjkyqyhimw9$.dlg@40tude.net> <1146134530.434869.47230@t31g2000cwb.googlegroups.com> <16tpmi2zjzfmv.x68lm40hqvl8$.dlg@40tude.net> NNTP-Posting-Host: 212.190.145.10 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1146144048 11027 127.0.0.1 (27 Apr 2006 13:20:48 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 27 Apr 2006 13:20:48 +0000 (UTC) In-Reply-To: <16tpmi2zjzfmv.x68lm40hqvl8$.dlg@40tude.net> User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 SEVPXS01 Complaints-To: groups-abuse@google.com Injection-Info: t31g2000cwb.googlegroups.com; posting-host=212.190.145.10; posting-account=ZjNXewwAAADyBPkwI57_UcX8yKfXWOss Xref: g2news2.google.com comp.lang.ada:3952 Date: 2006-04-27T06:20:42-07:00 List-Id: Dmitry A. Kazakov wrote: > On 27 Apr 2006 03:42:10 -0700, Ludovic Brenta wrote: >> Dynamic dispatching, by definition, means that you don't know which >> subprogram you call at run-time. The compiler guarantees that the call >> will succeed (i.e. that there exists a subprogram to dispatch to), >> but there is uncertainty about which one it is. > > (I have an impression that it will not be true in Ada 200Y.) No, nothing changes in this respect, just synctactic sugar. > OK, but this is the same uncertainty as in X + 1. You don't know X, so the > result selected by "+" is uncertain (to you.) Are programs using "+" > certifiable? Yes, programs using "+" are certifiable. To obtain the certification, you prove that X+1 is within range and that the operation does not raise an exception. Ada's type safety features go a long way to help us there, so we only have to test for a few boundary cases. SPARK takes that to its logical conclusion, i.e. static proof. >> A static procedure call has no uncertainty: when you read the program >> source, you know exactly which subprogram is called, even in the >> presence of overloading. > > Well, no: > > if Read (File) then > Foo; > else > Bar; > end if; > > The uncertainty of a dispatching call is one of the context, exactly as in > the example above. Nothing in your example is uncertain. Whatever path execution takes, you know exactly what's happening. > Provided, that there is nothing uncertain in how > dispatching works or what potential targets do. But with compiler-provided dynamic dispatching, there *is* uncertainty as to how dispatching works and what the targets are. -- Ludovic Brenta.