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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.3.155 with SMTP id e27mr32082202ioi.22.1514856471968; Mon, 01 Jan 2018 17:27:51 -0800 (PST) X-Received: by 10.157.92.195 with SMTP id r3mr1965907oti.8.1514856471731; Mon, 01 Jan 2018 17:27:51 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.unit0.net!peer02.am4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!i6no4877794itb.0!news-out.google.com!b73ni19072ita.0!nntp.google.com!g80no4865498itg.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 1 Jan 2018 17:27:51 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:645:c001:2a91:590b:9ec8:8c28:c02a; posting-account=fxr6CwoAAABjARAbZ01okNaxDpxQT8RH NNTP-Posting-Host: 2601:645:c001:2a91:590b:9ec8:8c28:c02a References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Why *.adb and *.ads? From: Mace Ayres Injection-Date: Tue, 02 Jan 2018 01:27:51 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Body-CRC: 361049200 X-Received-Bytes: 3051 Xref: reader02.eternal-september.org comp.lang.ada:49717 Date: 2018-01-01T17:27:51-08:00 List-Id: Andrew, you may think of the *.abs and *.abs as source code in the traditio= n way. The *.ads is the speficition (the =E2=80=98s=E2=80=99 of ads) file, = which specifies the sub programs (functions, procedures) types, and other c= omponents of the (package). The corresponding *.adb in the full body, elaborated, details of the specif= ications (promise of functions, procedures, types, etc.) specified in the *= abs specification. This provides rigorous delivery of the abstraction aspect of Ada. Think of = hiring a very reliable consultant to build x, which will various things in = a safe and reliable way. The contract you sign promises the WHAT will be de= livered, the specifications in the *abs file. The contractor plans, schedul= es, gather resources and supervises the delivery of the specification.=20 You don=E2=80=99t need to see all the details of how the work is done. In f= act you, or other components of the overall program, don=E2=80=99t want to = know. If the contractor uses Bob instead of Alice to do part of x, you don= =E2=80=99t care as long the the specification of delivery remains consisten= t. test.abs .. procedure say_hello (message :string in out); end test; =E2=80=94 speficiation test,adb =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94- Procedure say_hello is Begin put_line(message); end test. =E2=80=94 body to use procedue say_hello somewhere, I have=E2=80=9D If happy then=20 say_hello (=E2=80=9Ci am happy=E2=80=9D); else say_hello(=E2=80=9CNot so happy=E2=80=9D); end if; The details of the implementation of say_hello may change in the body *.adb= , as long as the procedure definition in the *.abs and *adb domain the same= . t