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,b14a804025dceb20 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-10-30 04:15:52 PST Path: supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!xfer13.netnews.com!netnews.com!newsfeed.skycache.com!Cidera!cyclone2.usenetserver.com!news-out.usenetserver.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!news.mindspring.net!firehose.mindspring.com!not-for-mail From: Marin David Condic Newsgroups: comp.lang.ada Subject: Re: Constructors/Destructors in Ada95 Date: Mon, 30 Oct 2000 07:13:47 -0500 Organization: Quadrus Corporation Message-ID: <39FD65FB.388A05D0@acm.org> References: <8ti9lp$7se$1@nnrp1.deja.com> NNTP-Posting-Host: d1.56.b5.4b Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 30 Oct 2000 12:13:51 GMT X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en To: rwilson007007@my-deja.com Xref: supernews.google.com comp.lang.ada:1627 Date: 2000-10-30T12:13:51+00:00 List-Id: rwilson007007@my-deja.com wrote: > That is, rather than being tempted to overload Ada's assignment > operator, I would prefer to replace: > "My_Object = new My_Class_Name (Argument_List)" in C++ > with > "package My_Object is new My_Class_Name.Instance (Argument_List)" > in Ada (see example below...). > > ** Could one of the wise participants in this discussion please > instruct me as to whether or not there is some fundamental problem or > limitation with Ada generics that makes this an unsensible approach?** Very clever! However, at least one issue would be raised. A generic instanciation of My_Class_Name would result in a duplication of the object code associated with My_Class_Name for every object of that class you declare. This is at least true of every Ada compiler of which I am aware. I don't know if anybody supports code sharing for generics on a currently marketed Ada95 compiler. This technique could thus prove to be expensive for classes where lots of objects are declared. Also, there could be some time penalty in runtime instanciation that may be significant for classes with lots of objects associated with them. MDC -- ====================================================================== Marin David Condic - Quadrus Corporation - http://www.quadruscorp.com/ Send Replies To: m c o n d i c @ q u a d r u s c o r p . c o m Visit my web site at: http://www.mcondic.com/ "Giving money and power to Government is like giving whiskey and car keys to teenage boys." -- P. J. O'Rourke ======================================================================