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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,cb04cee6116c8ced X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!z19g2000yqk.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Re: Package's private parts and protected types Date: Tue, 9 Feb 2010 11:34:28 -0800 (PST) Organization: http://groups.google.com Message-ID: <4e959c35-34d1-49fb-b1eb-5b298e42610f@z19g2000yqk.googlegroups.com> References: <7ff3810f-3ee3-4f39-a54c-933ad7d0655c@36g2000yqu.googlegroups.com> <1v2la97s2yyvd.1rcy0ana8mver.dlg@40tude.net> <3bb38996-47f7-4f30-8255-f011501404b5@b10g2000yqa.googlegroups.com> NNTP-Posting-Host: 79.91.74.81 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1265744068 17600 127.0.0.1 (9 Feb 2010 19:34:28 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 9 Feb 2010 19:34:28 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z19g2000yqk.googlegroups.com; posting-host=79.91.74.81; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:9047 Date: 2010-02-09T11:34:28-08:00 List-Id: On 9 f=E9v, 15:47, Robert A Duff wrote: > I agree that it's good to avoid heap management when possible. > But why can't you declare local variables of type My_Interface'Class, > initialized with build-in-place function calls? > > - Bob Synchronized-and-the-like interface types are limited, so the built-in- place is indeed really built-in-place (no kind of conversion allowed at any stage). The initializer function have to return a class wide and return it using an extended return statement which is required to return the same exact type/subtype as the one function returns. This way of doing thing is not compatible with the implementation- hiding requirement, as it would require the implementation type to be exposed in the public part, so that I could define a public function returning this exact type.