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: a07f3367d7,6b1bfc6ba4e8ada X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!news2.euro.net!82.197.223.108.MISMATCH!feeder8.cambrium.nl!feed.tweaknews.nl!195.238.0.231.MISMATCH!news.skynet.be!195.238.0.222.MISMATCH!newsspl501.isp.belgacom.be!tjb!not-for-mail Date: Mon, 18 May 2009 12:23:11 +0200 From: Olivier Scalbert User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: newbie problem References: <4a0ad646$0$2854$ba620e4c@news.skynet.be> <4a0b0aa2$0$2846$ba620e4c@news.skynet.be> <5e500136-c9a5-4fca-8e7c-63d5bd09cb71@o20g2000vbh.googlegroups.com> <4a0b241c$0$2846$ba620e4c@news.skynet.be> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4a11370a$0$2868$ba620e4c@news.skynet.be> Organization: -= Belgacom Usenet Service =- NNTP-Posting-Host: f6a4f1fc.news.skynet.be X-Trace: 1242642186 news.skynet.be 2868 87.65.184.16:60582 X-Complaints-To: usenet-abuse@skynet.be Xref: g2news2.google.com comp.lang.ada:5886 Date: 2009-05-18T12:23:11+02:00 List-Id: sjw wrote: > We proposed a (joke) coding standard that the length of a name should > be log-base-2 the length of its scope in lines. So I might be quite > happy with Output : File_Type; for example. Depends whether you have > anything else that might be confused with it. Hi, I have reorganized the code a little bit. ------------------------------------------ -- audio.ads ------------------------------------------ package audio is type Amplitude is new Float; type Frequency is new Float; type Time is new Float; type Stereo_Amplitude is record Left : Amplitude; Right: Amplitude; end record; end audio; ------------------------------------------ -- audio-als.ads ------------------------------------------ private with Ada.Sequential_Io; package audio.als is type File is limited private; procedure Create (F: out File; File_Name: String); procedure Write (F: in File; Sample: Stereo_Amplitude); procedure Close (F: out File); procedure Get_Min_Max (File_Name: String; Min: out Amplitude; Max: out Amplitude); private package Stereo_Amplitude.Io is new Ada.Sequential_Io (Stereo_Amplitude); type File is record File_Type: Stereo_Amplitude_Io.File_Type; -- perhaps more stuff later end record; end audio.als; ------------------------------------------ -- audio-als.adb ------------------------------------------ ... When I do: gnatmake audio-als.adb, I've got: gnatmake audio-als.adb gcc-4.3 -c audio-als.adb audio-als.ads:14:09: child unit allowed only at library level line 14 is : package Stereo_Amplitude.Io is new Ada.Sequential_Io (Stereo_Amplitude); I must admit that I have no idea on how to solve it ... Olivier