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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: What do you think about this? References: <9894cde7-2cf8-4060-be65-857812ad7b09@googlegroups.com> <17436268-aceb-461f-bdcf-eee8436cd0e6@googlegroups.com> <86y4jaqzdx.fsf@stephe-leake.org> <86oak5qulb.fsf@stephe-leake.org> <78882aed-4063-409b-a92e-6025c3097a52@googlegroups.com> <6d3e7a4c-e691-4005-ad47-2507ed13031f@googlegroups.com> Date: Sun, 28 Jun 2015 09:08:54 -0500 Message-ID: <86fv5cq615.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt) Cancel-Lock: sha1:nVtRNvLARnFwAndcWy8sr2P+vMw= MIME-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 18598558ffff9e97f808423036 X-Received-Bytes: 2482 X-Received-Body-CRC: 3190751793 Xref: news.eternal-september.org comp.lang.ada:26509 Date: 2015-06-28T09:08:54-05:00 List-Id: Laurent writes: > On Thursday, 25 June 2015 00:30:32 UTC+2, Jeffrey R. Carter wrote: > > It sucks that renaming function Make_Antibiotique... to function > Antibiotique ... doesn't work because I get conflicts between the Type > Antibiotique and the function. So what is the recommendation for > naming in this case. > > package Antibiotiques... > > type Antibiotique is private; > > function Make_Antibiotique... return Antibiotique; > > end Antibiotiques; On option, that is often (but not always) used in the Ada Reference Manual, is to append "_Type" to the type name whenever you run into this problem. That way, you don't have to waste time thinking of a "better" name; you've already found the best name, but Ada won't let you use it, so you need to add some noise. Make the noise extremely consistent, so it is easy to ignore. However, in this particular case, I agree with Simon; just use "Make" as the name of the function; there is no need to repeat the name of the package in the function name. For that matter, there is no need to repeat the name of the package in the type either: package Antibiotiques is type Object is private; function Make () return Object; ... -- -- Stephe