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=2.0 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,35782846f963b1e5,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.220.230 with SMTP id pz6mr17287652pbc.3.1341702538117; Sat, 07 Jul 2012 16:08:58 -0700 (PDT) Path: l9ni11086pbj.0!nntp.google.com!news2.google.com!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Nasser M. Abbasi" Newsgroups: comp.lang.ada Subject: on the need to duplicate code for procedure signature in both body and interface files Date: Sat, 07 Jul 2012 18:08:53 -0500 Organization: Aioe.org NNTP Server Message-ID: Reply-To: nma@12000.org NNTP-Posting-Host: KdJUrTuvv3Zv/s8pPxNluw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-07-07T18:08:53-05:00 List-Id: 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). I do not like duplicating code at all. Even if it is only for the signature of the API, and even though the Ada compiler will catch any difference (assuming one changes the .ads and forget to update the .adb for example). Was there no other alternatives to avoid this situation when Ada was originally designed in order to keep the same good concept of separating the interface from the body, but somehow at the same time, eliminate the need to duplicate by hand the API definition code in 2 separate places? I am using GNAT. I Assume this is the same in other Ada implementations. thanks, --Nasser