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-Thread: 103376,b8b8a54001adc4d2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Possible Ada deficiency? References: <1104516913.718856.94090@z14g2000cwz.googlegroups.com> <1104544963.930877.75170@c13g2000cwb.googlegroups.com> <1104595073.731663.180100@c13g2000cwb.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Sat, 08 Jan 2005 19:11:30 GMT NNTP-Posting-Host: 63.189.32.52 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.pas.earthlink.net 1105211490 63.189.32.52 (Sat, 08 Jan 2005 11:11:30 PST) NNTP-Posting-Date: Sat, 08 Jan 2005 11:11:30 PST Xref: g2news1.google.com comp.lang.ada:7572 Date: 2005-01-08T19:11:30+00:00 List-Id: Robert A Duff wrote: > > The main thing is that the compiler needs to know the size of a private > type in order to allocate things, unless it treats all private types as > dynamic-sized, which would be annoying -- you shouldn't have to pay an > efficiency cost to get the benefits of encapsulation, information > hiding, etc. So if the full type were in the body, the compiler would > have to look at the body (at least in optimizing mode). It's always seemed to me that such types could be implemented as access types, allocated where declared, deallocated when they went out of scope, and with all operations dealing with the designated value, not the access value. All such types would, of course, be passed by reference. -- Jeff Carter "Sir Robin the-not-quite-so-brave-as-Sir-Lancelot, who had nearly fought the Dragon of Angnor, who nearly stood up to the vicious Chicken of Bristol, and who had personally wet himself at the Battle of Badon Hill." Monty Python & the Holy Grail 68