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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,81bb2ce65a3240c3 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.149.210 with SMTP id u18mr157767bkv.1.1335752886383; Sun, 29 Apr 2012 19:28:06 -0700 (PDT) Path: h15ni181171bkw.0!nntp.google.com!news2.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: sbelmont700@gmail.com Newsgroups: comp.lang.ada Subject: Re: What would you like in Ada202X? Date: Sun, 29 Apr 2012 19:00:58 -0700 (PDT) Organization: http://groups.google.com Message-ID: <10752530.156.1335751258308.JavaMail.geo-discussion-forums@ynek6> References: <3637793.35.1335340026327.JavaMail.geo-discussion-forums@ynfi5> <13849842.838.1335485882969.JavaMail.geo-discussion-forums@vbai3> <134641.307.1335542673651.JavaMail.geo-discussion-forums@pbrx5> <2867357.127.1335561067669.JavaMail.geo-discussion-forums@ynee1> <12278359.1638.1335669649223.JavaMail.geo-discussion-forums@ynei5> <13229240.2409.1335714174197.JavaMail.geo-discussion-forums@vbuo17> <25563681.2104.1335742164732.JavaMail.geo-discussion-forums@ynee1> NNTP-Posting-Host: 206.53.78.59 Mime-Version: 1.0 X-Trace: posting.google.com 1335752886 14098 127.0.0.1 (30 Apr 2012 02:28:06 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 30 Apr 2012 02:28:06 +0000 (UTC) In-Reply-To: <25563681.2104.1335742164732.JavaMail.geo-discussion-forums@ynee1> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=206.53.78.59; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-04-29T19:00:58-07:00 List-Id: On Sunday, April 29, 2012 7:29:24 PM UTC-4, Shark8 wrote: > In all likelihood an auto-deallocate would be an null procedure which is = extended by the other classes. (i.e. doing what we've described, but in thi= s case hidden from the programmer.) >=20 The auto-deallocate scheme I was refering to is to remove the 'free' proced= ure entirely. Whenever the object is finalized (by the language, not user-= defined finalization), all the elements of the record will be finalized as = well. So the concrete type that contains some sort of Auto_Deallocated_Fil= e_Pointer type (that is, itself, controlled) would close the file pointer a= utomatically, and concrete types that contain nothing would do just that. = Free doesn't exist, and certainly isn't null. Generally I have found that schemes that rely on explictly calling dealloca= tion routines are rarely, if ever, exception safe and normally tend to prod= uce memory leaks. If you have to deallocate 'n' items and an exception is = raised after item 'x', then you leak the memory for n-x items (or have inco= mprehensible sets of nested exception handlers). But this is beside the po= int. > That's just it though. Thing like the free/deallocate mentioned ARE valid= for all types in that class-hierarchy, it's just that (even as you admitte= d) sometimes it's a NOP. >=20 Having nothing to do is not the same as it having been done, and that's a d= angerous philosophy to adhere to. Free is not valid for a type if there is= nothing to free, and extending landing gear is not valid for a plane with = fixed gear. If you were using a straight procedural model (without inherit= ance), would you go to all the trouble of creating a Free procedure without= any code and calling it to accomplish nothing? Trying to fake a common in= terface does not make for an abstract program.