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 Path: g2news2.google.com!news4.google.com!news.glorb.com!news2.arglkargh.de!noris.net!newsfeed.arcor.de!news.arcor.de!not-for-mail Date: Thu, 27 Apr 2006 17:51:19 +0200 From: Georg Bauhaus User-Agent: Thunderbird 1.5.0.2 (Windows/20060308) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: procedural vs object oriented References: <1146039364.130635.181590@v46g2000cwv.googlegroups.com> <871wvjh9te.fsf@ludovic-brenta.org> <1xs8jrwjj0dx2$.1ksjkyqyhimw9$.dlg@40tude.net> <1146134530.434869.47230@t31g2000cwb.googlegroups.com> <4450FD24.2020205@obry.net> In-Reply-To: <4450FD24.2020205@obry.net> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <4451047b$0$4493$9b4e6d93@newsread2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 27 Apr 2006 19:50:51 MEST NNTP-Posting-Host: 236b4d9a.newsread2.arcor-online.net X-Trace: DXC=]Q;IPi_Ie>`a1IKbSTkC[iQ5U85hF6f;djW\KbG]kaMhVA=iV<7g:2eVEfmGSCIWnm=0F65HQV8ifeTh=]QkfNNl X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:3967 Date: 2006-04-27T19:50:51+02:00 List-Id: Pascal Obry wrote: > Maciej Sobczak a �crit : > >> In what way is this better or more certain than a dispatching call based >> on the tag? > > Static analysis is possible in this case. But static analysis should be possible for the following program, too, as long as for example `cons` returns references to object of a known finite set of types derived from T... At least possible in some defined set of cases, if slightly more difficult. procedure dis is package p is type T is tagged null record; type REF is access T'class; procedure op(x: T); type D1 is new T with null record; procedure op(x: D1); type D2 is new T with null record; procedure op(x: D2); end P; use P; function cons return REF; y: REF := cons; begin op(y.all); end;