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: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Q: Localizing type and package references Date: Sun, 05 Jan 2014 18:29:22 -0700 Organization: Also freenews.netfront.net; news.tornevall.net Message-ID: References: <7d03f160-7f52-4870-b4b3-a03d5b351bcb@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 6 Jan 2014 01:29:24 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="dd70bc7b132b065bb9f0baca90861430"; logging-data="7659"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/A4d8iobakIuUj+S2I+nWe6keBjZ2rU5c=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 In-Reply-To: <7d03f160-7f52-4870-b4b3-a03d5b351bcb@googlegroups.com> Cancel-Lock: sha1:uwniDICxpFJMIGYjYQoTFwG2lwM= X-Original-Bytes: 2989 Xref: number.nntp.dca.giganews.com comp.lang.ada:184360 Date: 2014-01-05T18:29:22-07:00 List-Id: On 01/05/2014 04:55 PM, b.mcguinness747@gmail.com wrote: > > -------------------------------------------------------------------------------- > -- Types - Declarations of data types and related packages > -------------------------------------------------------------------------------- > with Ada.Characters; > with Ada.Characters.Wide_Latin_1; > with Ada.Strings; > with Ada.Strings.Wide_Maps; > with Ada.Strings.Wide_Unbounded; > with Ada.Wide_Characters; > with Ada.Wide_Characters.Handling; > with Ada.Wide_Text_IO; > with Ada.Wide_Text_IO.Text_Streams; > > package Types is > package Chars renames Ada.Characters.Wide_Latin_1; > package Char_Handling renames Ada.Wide_Characters.Handling; > package Char_IO renames Ada.Wide_Text_IO; > package Char_Maps renames Ada.Strings.Wide_Maps; > package Char_Streams renames Ada.Wide_Text_IO.Text_Streams; > package Char_Strings renames Ada.Strings.Wide_Unbounded; > > subtype Char is Wide_Character; > subtype Char_String is Ada.Strings.Wide_Unbounded.Unbounded_Wide_String; > end Types; > > and then tried referencing this from the main program file with: > > with Types; > use Types; > > with Char_Strings; > > but the compiler (Gnat 4.6) complains that there is no file called > char_strings.ads. I am not sure if I have made a simple mistake that > can be easily corrected to make this work, or if there is a different > approach that I should be trying. You can only with a library-level package, one not declared in anything else. Char_Strings is declared in package types, so it's not library level and can't be withed. -- Jeff Carter "Spam! Spam! Spam! Spam! Spam! Spam! Spam! Spam!" Monty Python's Flying Circus 53