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!feeder.eternal-september.org!newsfeed1.swip.net!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed-00.mathworks.com!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Multiple procedures in the same adb file? Date: Sun, 11 Jan 2015 16:02:12 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <5fc3a42d-f922-4e34-ab30-59613b980fb6@googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls7.std.com 1421010139 32391 192.74.137.71 (11 Jan 2015 21:02:19 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sun, 11 Jan 2015 21:02:19 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:LXpbYQL+w+NXBcOWsQOYeUpQaiQ= Xref: news.eternal-september.org comp.lang.ada:24539 Date: 2015-01-11T16:02:12-05:00 List-Id: John Smith writes: > Thanks, that was really helpful. You're welcome. >... I got it to work by making the appropriate *.ads and *.adb files. >I also had it working as a nested function. > > It seems a tad tedious at first, ... Yes, it's a nuisance for small programs. But for large programs, one compilation_unit per file with a file-naming convention is really the only sensible way. But I must admit, I'd prefer GNAT to be able to handle multiple compilation_units per file without so much horsing around. That's partly because when I'm debugging GNAT, I'm often working with very small test programs. If a customer hands me a huge program that causes GNAT to crash, I'll usually try debugging it directly first, but if I can't figure it out quickly that way, I'll try making a small cut-down test that crashes in the same way. If the small test case contains 30 lines of code in 5 files, that's just a nuisance. So I use gnatchop. Most bug reports are already small. The biggest one I had to deal with at AdaCore was about 37,000,000 lines of code. > ...but it does make sense. Heck, even C/C++ recommends a similar > approach. You want to separate the declaration from the > implementation. Right, same idea. - Bob