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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Access parameters and accessibility Date: Mon, 15 Dec 2014 22:02:08 +0100 Organization: cbb software GmbH Message-ID: References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: hqKFxjbs7Ua2waAvqYcAsQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:24022 Date: 2014-12-15T22:02:08+01:00 List-Id: On Mon, 15 Dec 2014 21:23:02 +0100, Michael B. wrote: > I don't want to use this stuff for my own code. My problem is that I > want to understand object orientation in Ada. And this seems to be > impossible without a complete understanding of access types in all flavors. You don't need access types to understand Ada's OO. Furthermore accessibility checks and information has nothing to do with OO. > So would you please help me to understand this paragraph? It says that some information is hanged on the pointer's value implicitly. The information contains a description of the context where the pointer was obtained. By this it violates manifest typing principle. It also does nominal typing. Both are Ada's type system keystones. The accessibility information is used on some other context where the pointer is dereferenced or copied, in order to generate an exception depending on the relation of this context to the origin context. The rationale for this is that the pointer *might* become dangled, which in most practical cases just wrong. The problem with the idea that the decision is taken according to the pointer contexts, not the context of the object itself (which would be impossible). So, basically, it is just an arbitrary exception generator. Since the thing sometimes generates exception and sometimes does not, it also violates important OO principles, such as substitutability. Because it makes the behavior context-dependent. In short, it is a mess, the only thing you need to know about is how to avoid it in your program. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de