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 X-Received: by 2002:a24:e14a:: with SMTP id n71-v6mr1968744ith.55.1536763673426; Wed, 12 Sep 2018 07:47:53 -0700 (PDT) X-Received: by 2002:aca:5557:: with SMTP id j84-v6mr95972oib.3.1536763673287; Wed, 12 Sep 2018 07:47:53 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.linkpendium.com!news.linkpendium.com!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!x81-v6no346038ita.0!news-out.google.com!z5-v6ni199ite.0!nntp.google.com!x188-v6no344239ite.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 12 Sep 2018 07:47:53 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=73.205.150.94; posting-account=Ru7E4QoAAAC_HiQ2D8LjZ7rh1mbTNcVn NNTP-Posting-Host: 73.205.150.94 References: <7a6b1ae7-f142-458d-ab01-c36c8ed30659@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9a44824f-2897-48f0-92b1-3e9528147ef6@googlegroups.com> Subject: Re: Error: "non-local pointer cannot point to a local object" From: NiGHTS Injection-Date: Wed, 12 Sep 2018 14:47:53 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:54333 Date: 2018-09-12T07:47:53-07:00 List-Id: On Wednesday, September 12, 2018 at 3:26:46 AM UTC-4, Dmitry A. Kazakov wro= te: > What goal? It looks like a bad design. Copying pointers to integers is=20 > asking for trouble. The integer was chosen to simplify the example. In the actual application i= t is a tree container, where there is a single thread that is expected to m= anipulate various contexts of the same tree, thus multiple working records = for the same tree. >=20 > BTW, if you used Ada.Finalization.Controlled, as you likely should, and= =20 > derived one record from another then default copying before Adjust would= =20 > copy pointer too. What would happen with access info, I have no idea,=20 > probably copied as-is. (Yet another reason not to use anonymous access=20 > types inside records unless for Rosen's trick or access-to-constant) >=20 While my example does not show Ada.Finalization.Controlled in use, my appli= cation's record indeed is derived from this object. Still, I am not sure ho= w overriding Adjust would be applied to my example. Would you show me a qui= ck and dirty example of how this would be done? > --=20 > Regards, > Dmitry A. Kazakov > http://www.dmitry-kazakov.de