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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,bf608b8936d68540 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.224.59.205 with SMTP id m13mr29603961qah.7.1367766018419; Sun, 05 May 2013 08:00:18 -0700 (PDT) X-Received: by 10.49.106.231 with SMTP id gx7mr1422324qeb.6.1367766018397; Sun, 05 May 2013 08:00:18 -0700 (PDT) Path: y6ni0qax.0!nntp.google.com!m7no2395057qam.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 5 May 2013 08:00:18 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=206.53.78.59; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy NNTP-Posting-Host: 206.53.78.59 References: <143a8db3-c14b-4983-a481-4b998aea42af@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <7a248ba5-9fbc-4326-bbb8-eec3c125d455@googlegroups.com> Subject: Re: Accessing finalized values From: sbelmont700@gmail.com Injection-Date: Sun, 05 May 2013 15:00:18 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2013-05-05T08:00:18-07:00 List-Id: On Friday, May 3, 2013 6:36:08 PM UTC-4, Randy Brukardt wrote: >=20 > This is perfectly legitimate, although arguably pathological. > Pathological seems like an understatement; it seems like a pretty major cat= ch-22. If the whole purpose of Finalize is "to ensure that proper cleanup = is performed prior to the object becoming permanently inaccessible", but it= s perfectly legitimate to access the object after Finalize has been called,= then writing 110% bulletproof code becomes much more complex. How is an o= bject supposed to free its resources if the resources must still be made av= ailable? =20 For instance, suppose finalization for a File type closes the file; if it h= as to assume that other code might call Read and Write subprograms after Fi= nalize has been executed, the file must stay open and the point is moot (or= it must add preconditions to every operation). It would seem like the sam= e rules for protected types should apply to non-protected types as well, fo= r all the same reasons. -sb