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-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!e24g2000vbe.googlegroups.com!not-for-mail From: Martin Newsgroups: comp.lang.ada Subject: Re: newbie problem Date: Mon, 18 May 2009 03:48:15 -0700 (PDT) Organization: http://groups.google.com Message-ID: <10de3ef4-bd55-4911-bb28-bd6536fc16bc@e24g2000vbe.googlegroups.com> 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> <4a11370a$0$2868$ba620e4c@news.skynet.be> NNTP-Posting-Host: 20.133.0.8 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1242643695 6401 127.0.0.1 (18 May 2009 10:48:15 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 18 May 2009 10:48:15 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e24g2000vbe.googlegroups.com; posting-host=20.133.0.8; posting-account=g4n69woAAACHKbpceNrvOhHWViIbdQ9G User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:5887 Date: 2009-05-18T03:48:15-07:00 List-Id: On May 18, 11:23=A0am, Olivier Scalbert wrote: > 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 > > =A0 =A0 =A0type Amplitude is new Float; > =A0 =A0 =A0type Frequency is new Float; > =A0 =A0 =A0type Time =A0 =A0 =A0is new Float; > > =A0 =A0 =A0type Stereo_Amplitude is record > =A0 =A0 =A0 =A0 =A0Left : Amplitude; > =A0 =A0 =A0 =A0 =A0Right: Amplitude; > =A0 =A0 =A0end 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 =A0(F: in =A0File; Sample: Stereo_Amplitude); > procedure Close =A0(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 > =A0 =A0 =A0File_Type: Stereo_Amplitude_Io.File_Type; > =A0 =A0 =A0-- 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 Change package Stereo_Amplitude.Io to package Stereo_Amplitude_Io Cheers -- Martin