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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,56131a5c3acc678e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-04 11:14:59 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Question about OO programming in Ada Date: Thu, 4 Dec 2003 13:13:30 -0600 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <8urxb.19482$sb4.18182@newsread2.news.pas.earthlink.net> <1792884.HtYz4Yv8lY@linux1.krischik.com> <1070466281.168920@master.nyc.kbcfp.com> <1070490862.478119@master.nyc.kbcfp.com> <2prtsvgmt5lt3u1ulb5dvh8ba5nulfl3l3@4ax.com> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:3131 Date: 2003-12-04T13:13:30-06:00 List-Id: "Dmitry A. Kazakov" wrote in message news:2prtsvgmt5lt3u1ulb5dvh8ba5nulfl3l3@4ax.com... > The point is that calling Free from Finalize is revolting. This would > not be necessary if finalization of the type Pointer called > deallocator in addition to a call to Finalize. It's not just revolting, it's dangerous. What if "Object" is declared locally: declare X : Object; begin You're giving the heap memory that isn't its in the first place. More commonly, Object will be a component of some other record. In either case, having a "hidden" restriction that Object can only be allocated (the thing you want to avoid when possible!) is really, really dumb. I'd expect that to be true in C++ as well -- or does C++ not even allow statically allocated class objects and class components? (If they always have to be allocated from the heap, there is no problem.) Randy.