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,35782846f963b1e5 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.190.104 with SMTP id gp8mr18925787pbc.4.1341767581037; Sun, 08 Jul 2012 10:13:01 -0700 (PDT) Path: l9ni11158pbj.0!nntp.google.com!news2.google.com!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Brian Drummond Newsgroups: comp.lang.ada Subject: Re: on the need to duplicate code for procedure signature in both body and interface files Date: Sun, 8 Jul 2012 17:13:00 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <527261bb-13d1-4ba7-9e03-1992e54a5532@googlegroups.com> Mime-Version: 1.0 Injection-Date: Sun, 8 Jul 2012 17:13:00 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="DkTdSjxOCm6DqG+Uf7eArg"; logging-data="5429"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1836SlRYHoTltNAWIYEBeDHnmmlkRAQ8Iw=" User-Agent: Pan/0.135 (Tomorrow I'll Wake Up and Scald Myself with Tea; GIT 30dc37b master) Cancel-Lock: sha1:H+SCxrVFZToQRlZ0VudXxPsFJ1U= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: 2012-07-08T17:13:00+00:00 List-Id: On Sat, 07 Jul 2012 21:01:30 -0700, Shark8 wrote: > On Saturday, July 7, 2012 5:08:53 PM UTC-6, Nasser M. Abbasi wrote: >> Basic question from an Ada newbie. >> >> One thing that always bothered me in Ada is the need to physically >> duplicate the code that represents the API of the package procedures >> and functions in both the interface and the body files (.ads and .adb). > My suggestion here is to let the compiler point out your errors. Unlike > C/C++ an Ada compiler is your friend. There might be an adb -> ads > generator laying around where you can just feed it an adb file and have > it spit out the ads-file, but I've never had reason to look for one. And the best it could do would be a first pass at the ADS-file. Without further information it would expose a lot of procedures properly kept internal to the implementation (thus the ADB file). You would have to delete the rest yourself, or add annotations in the ADB file (heh, how about "static" declarations :-) - Brian - Brian