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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b30bd69fa8f63cb2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-20 00:07:52 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!dialin-145-254-037-160.arcor-ip.NET!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: C bug of the day Date: Fri, 20 Jun 2003 09:10:39 +0200 Organization: At home Message-ID: References: <1054751321.434656@master.nyc.kbcfp.com> <7gBHa.12174$KF1.273806@amstwist00> <7RQHa.3141$Uh2.339@nwrdny01.gnilink.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-037-160.arcor-ip.net (145.254.37.160) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: fu-berlin.de 1056092870 24589606 145.254.37.160 (16 [77047]) User-Agent: KNode/0.7.1 Xref: archiver1.google.com comp.lang.ada:39479 Date: 2003-06-20T09:10:39+02:00 List-Id: Hyman Rosen wrote: > Dmitry A. Kazakov wrote: >> They do require "inheritance". That special controlled type is called >> "class" in C++. You cannot have a destructor for, say, "char *" (you >> cannot even derive from it). > > No. You cannot write a destructor for 'char *' because that is a system > type, and it already has one. Every built-in type has one. If you want to > write a destructor, it has to be for a type you define. Surely. Destructor is defined for new types. The point is that you cannot make a new type from "char *" [in Ada you can but in a limited form]. Thus you cannot produce an equivalent of "char *" plus your destructor. You have to aggregate it in a class. Which is same as in Ada, where you have to put it in a controlled type. So I see no difference here. > Having to inherit > from a special type to get finalization is especially cumbersome in a > language which does not have multiple inheritance. Oh yes. My point is that a language have to allow: 1. full inheritance from any types. [except, probably, class-wide types] 2. multiple inheritance Missing 2. in Ada is clearly a design fault. No matter which work-arounds (like access discriminants) it provides. Similar problem exists in Ada child packages. A package may have only one parent. This also have work-arounds and they also as nasty as all work-arounds are. -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de