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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada wikibook help needed (O-O) Date: Sun, 23 Apr 2017 19:03:44 +0200 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: BYuA7L7MRjuLLjcoGHOBxw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:46614 Date: 2017-04-23T19:03:44+02:00 List-Id: On 2017-04-23 18:09, G.B. wrote: > On 23.04.17 12:52, Dmitry A. Kazakov wrote: >> On 2017-04-23 12:22, G.B. wrote: >> >>> The page goes to some length to explain static dispatching >>> vs. dynamic dispatching, but fails to introduce "dispatching" >>> first, as a term, or to reference some suitable definition. >> >> It does in the section "Polymorphism, class-wide programming and >> dynamic dispatching". Dispatching is a mechanism of polymorphic call >> implementation for the case of dynamic polymorphism. >> >>> Then, >>> >>> "A conversion to the class-wide type makes [components] visible >>> again." >>> >>> Is "visible" correct? >> >> Why not? > > Converting to T'Class does not make any components of T'Class visible > if they are private, at the point in source of that conversion. > In this sense, it is unfortunate that "view" in "view conversion" > might trigger an association with "visibility" in the reader's mind. Yes, you are right, conversion to T'Class does not add anything it can only subtract something. But, maybe, direct visibility was meant? Say, T is declared in P and S is declared in Q: package P is type T is tagged ...; procedure Foo (X : T); end P; package Q is type S is new P.T with ...; end Q; If I have "use P" and no "use Q" then conversion to T'Class will make Foo applicable in non-prefix notation. > Yet, what is meant is that after view conversion, the object can > be seen as of any type in T'Class, whichever type it might be. No, that requires another conversion. To see X as S from T'Class you must convert it to S. T'Class is a substitute for the intersection of all types [values of]. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de