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!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: What do you think about this? Date: Sat, 27 Jun 2015 10:43:39 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: 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> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Sat, 27 Jun 2015 17:42:19 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="a3855fbfe1a666be9aefba0563039ed5"; logging-data="16929"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19iEHf8ST0wEnEUKQLKTlWjg7SD7HKdggE=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <6d3e7a4c-e691-4005-ad47-2507ed13031f@googlegroups.com> Cancel-Lock: sha1:OqxjxP9ptczMUHbRavjbfdfaL6E= Xref: news.eternal-september.org comp.lang.ada:26494 Date: 2015-06-27T10:43:39-07:00 List-Id: On 06/27/2015 10:12 AM, Laurent wrote: > > How is that the compiler accepts that part "return A & B & C;"? Or is that > some sort of shortcut which has been introduced at some point. I have seen it > been used quite often in JB Ada 2005 and it even works with more complex > types but I didn't find an detailed explanation. The syntax for a function return is return ; where has the correct type. Here the correct type is String, and the expression has type String. > 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; First I would recommend against mixing languages. Since Ada reserved words are almost entirely English words, this implies using English identifiers. I would do package Antibiotics is type Antibiotic_Info is private; function Antibiotic ... return Antibiotic_Info; end Antibiotics; -- Jeff Carter "My brain hurts!" Monty Python's Flying Circus 21