comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: Global scope for instantiated generic package?
Date: Mon, 30 Aug 2010 15:28:42 +0200
Date: 2010-08-30T15:28:43+02:00	[thread overview]
Message-ID: <4c7bb20b$0$6774$9b4e6d93@newsspool3.arcor-online.net> (raw)
In-Reply-To: <5vWdnTd5Lf6uM-bRnZ2dnUVZ_oidnZ2d@giganews.com>

On 30.08.10 15:12, Trogdor wrote:
> 2) Where, speciffically, do I place the above two lines (and the 
> associated "with" line) so that I can BigInt_io.get from the main 
> body and the package subprograms as well?

One way to place the declarations is in a common package.

with Ada.Text_IO; use Ada.Text_IO;

package Big_Stuff is
   type BigInt is range 1..10_000_000_000_000;

   -- ... BigInt subprograms

   package BigInt_IO is new integer_IO(BigInt);
end Big_Stuff;

A main unit can then with package Big_Stuff (and "use"
it); the procedure bodies in Big_Stuff's body will see
BigInt_IO, too.


Georg



  parent reply	other threads:[~2010-08-30 13:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-30 13:12 Global scope for instantiated generic package? Trogdor
2010-08-30 13:25 ` Jacob Sparre Andersen
2010-08-30 13:28 ` Georg Bauhaus [this message]
2010-08-30 13:30 ` Ludovic Brenta
2010-08-30 13:47 ` Dmitry A. Kazakov
2010-08-30 18:49 ` Jeffrey Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox