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!mx02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Why does `Unchecked_Deallocation` need the access type? Date: Mon, 27 Jul 2015 15:20:37 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <5d6faxxdsssv.15g7kj5hv86mk$.dlg@40tude.net> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1438028439 10400 24.196.82.226 (27 Jul 2015 20:20:39 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 27 Jul 2015 20:20:39 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:27048 Date: 2015-07-27T15:20:37-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:5d6faxxdsssv.15g7kj5hv86mk$.dlg@40tude.net... > On Sun, 26 Jul 2015 00:11:22 -0700 (PDT), EGarrulo wrote: ... > What is indeed redundant here is the Object_Type. It is necessary because > Ada does not have access type introspection. That is, you cannot get the > object type from an access type, though the compiler knows it anyway. > Surely there should have been an attribute to get that type, e.g. > > Pointer_Type'Target > > But there is none. (1) The term is "designated type", so the attribute would be Pointer_Type'Designated. (2) Ada 83 did not have any type-valued attributes; it was considered a problem. ('Base was not an attribute in Ada 83; it could only be used as the prefix of another attribute.) Ada 95 changed that (for 'Base and 'Class), but there wasn't any consideration (that I know of) whether there would be any others that could make sense. (3) We recently had a proposal for 'Subtype that applies to an object. That would seem to be a similar sort of attribute, but it rapidly turned into a can of worms and it just didn't seem important enough to spend the time picking each worm out individually. (Kinda like what one does with old cheese... ;-) It's not clear to me whether 'Designated would have similar problems or whether it would work adequately (objects are complicated by anonymous subtypes and the fact that the prefix can include dynamic parts (i.e. function calls)). It might make sense to make a proposal to Ada-Comment. But in a lot of ways, it really needed to have been done for Ada 83, and for that we're 30+ years too late. Randy.