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,5afd69f1373c41cc X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,CP1252 Path: g2news2.google.com!postnews.google.com!t21g2000yqi.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Re: Interfacing with C ; an ununsed fields dilemma Date: Thu, 2 Jul 2009 06:21:01 -0700 (PDT) Organization: http://groups.google.com Message-ID: <9d9b5fe7-c990-4c67-9c6e-1dacd484b296@t21g2000yqi.googlegroups.com> References: <5a416858-4a52-412d-8051-6dadb5eadb2c@t21g2000yqi.googlegroups.com> <4a4ca38d$0$31340$9b4e6d93@newsspool4.arcor-online.net> NNTP-Posting-Host: 77.198.58.253 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1246540862 23504 127.0.0.1 (2 Jul 2009 13:21:02 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 2 Jul 2009 13:21:02 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t21g2000yqi.googlegroups.com; posting-host=77.198.58.253; 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: g2news2.google.com comp.lang.ada:6801 Date: 2009-07-02T06:21:01-07:00 List-Id: On 2 juil, 14:09, Georg Bauhaus wrote: > In case you are using current Ada, have you considered > making your type limited an use a "construtor function"?http://www.adacor= e.com/2007/05/28/gem-3/ But this still allow an automatic instantion without the required initialization. On the other hand, I like this sentence in the document you've pointed : =93 After all, interesting types are usually private, and we need some way for clients to create and initialize objects. =94 I oftenly feel the same, and I would probably have choose this design if I were to create a specification from the ground up (perhaps I'm driven into error by the existing C interface). Reading it in this context, make me think that perhaps I should use a more abstract specification, thus make these types (there are numerous records of the same kind) fully private and define numerous accessors to each of these types. I will no more bother to declare these unused fields, as this would be now in the private part.