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,ee887b7593f7961b X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!goblin2!goblin1!goblin.stu.neva.ru!news.tornevall.net!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada OS based on Minix3 Date: Wed, 12 Nov 2008 18:58:33 -0600 Organization: Jacob's private Usenet server Message-ID: References: <1pmkcuemqczer.j2i34pvc2lne$.dlg@40tude.net> <81912719-8c66-439d-a40e-529b22acd8a6@u29g2000pro.googlegroups.com> <14t6hwu8udm8j$.1x339y69m2ew1.dlg@40tude.net> <14ay3vz2ngj9s.1bmilwgckl3lc$.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1226537919 17089 69.95.181.76 (13 Nov 2008 00:58:39 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 13 Nov 2008 00:58:39 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Xref: g2news1.google.com comp.lang.ada:2662 Date: 2008-11-12T18:58:33-06:00 List-Id: "Dmitry A. Kazakov" wrote in message news:14ay3vz2ngj9s.1bmilwgckl3lc$.dlg@40tude.net... ... >>> 5. Getting a pool-specific pointer to the object upon >>> initialization/finalization, when the object is allocated in such a >>> pool. >>> (Unchecked_Conversion is really nasty there) >> >> I think you mean Unchecked_Access -- Unchecked_Conversion is not >> necessary. >> >> I don't see how this can make sense. In Initialize or Finalize, you >> don't know whether the object is in a pool, nor which pool. So how can >> you get a pool-specific pointer? > > That is exactly the problem. Consider objects allocated on a user-defined > pool. The object are linked into some list. When a new object is created > the "constructor" places it into the list. When the object is destroyed, > the "destructor" removes it. For both, you need a self-pointer, but you > cannot get it from an "in out" parameter. Sorry, but this is completely wrong. This is *exactly* how Claw works, and it works fine with Ada 95. It is perfectly OK to get a pointer from a parameter of a tagged object. You do have to use 'Unchecked_Access, but that is no problem if you are using Finalize to clean up. ... >> 10. Reify the finalization operation (that is, the operation on some >> type that calls Finalize on all the parts of it, including the >> whole). > > I.e. a destructor. But it is semantically broken to have such. It would > destroy an object leaving a dangling typed name of. > > I think that the trick can be achieved with an access type to some fake > storage pool. The Unchecked_Deallocation is called on the pointer. That > does the finalization. Then the pool's Deallocate is called, which does > nothing. Yup. And you can do that now. So what's the big deal. At worst, it's not as convinient as it could be. Most of the rest of the stuff that you and Bob have talked about is too incompatible to consider for Ada. A new Ada-like language could do these things, but there isn't much likelyhood of anyone using that. Randy.