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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,514d84d6930cf67 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: building a package -- newbie Date: Thu, 11 Nov 2004 19:27:38 +0100 Organization: None Message-ID: <1179574.14h7HiTikf@linux1.krischik.com> References: <3143fb37.0411110817.6e5200da@posting.google.com> Reply-To: martin@krischik.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1100197938 01 32022 iCmyXcJJaOy2qpM 041111 18:32:18 X-Complaints-To: usenet-abuse@t-online.de X-ID: VaVq1UZVgevO8IlzczWHMnaQ7cGSbrALGh1xZHksgdBDpgkpkx5gYT User-Agent: KNode/0.8.0 Xref: g2news1.google.com comp.lang.ada:6153 Date: 2004-11-11T19:27:38+01:00 List-Id: backdoc wrote: > I am working on an assignment for my Software Engineering class. We > must write a package and put statistical functions in it. I am using > Gnat and Linux. I've written a half dozen little applications using > Ada. But, this is my first experience with building my own package. > > So far, I've gotten the basic main procedure written. As long as I > don't try to WITH my package in, it will compile, read a binary file > and print the file contents. It's actually the float data I will have > to write statistical functions for. > > My instructor gave us the specifications. So, I just copied those > into a separate file. I plan to put the body of the package in the > same file as the specifications. No good. There is a special limitation in GNAT that allows only one package per file. So you need a seperate statistal_functions.adb file. > But, I wanted to get the main > procedure working with only the specifications first. > > My first real question is, "what extension should I use to name my > package?" statistal_functions.ads? statistal_functions.adb? In theory you can use any name you like. But GNAT is a lot more happy if you just use the lowercase packagename and replace '.' with '-'. > Do I > need to compile it before it can be WITH'd into my main program? No. "gnat make" will take care of everthing. Just "gnat make pkg" will do. > I > compile my main procedures with "gnatgcc -c file". Is that the same > for the package? "gnatgcc"? - the command for compiling ada is "gnat compile". But you are better of using "gnat make" then "gnat compile" since "gnat make" will compile all packages in one go. > Any suggestions? Yes: Read the GNAT Documentation! With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com