comp.lang.ada
 help / color / mirror / Atom feed
From: x24702@usma.edu (Zach Swanson)
Subject: Re: Package instance???
Date: 13 Feb 2002 14:25:33 -0800
Date: 2002-02-13T22:25:34+00:00	[thread overview]
Message-ID: <50c1a1b.0202131425.287cdaa5@posting.google.com> (raw)
In-Reply-To: OvBYEeMtBHA.1400@cpimsnntpa03

"Yates" <yates_1900@yahoo.com> wrote
> if I have a package 'My_Package',  can
> I do something like:
> 
> p1 : My_Package := new My_Package
> p2 : My_Package := new My_Package

Lets assume you have some packge like ada.integer_text_io.

then => package int_io renames ada.integer_text_io;
will rename that package to your specified identifier. The exact
syntax for package renaming declarations is in section 8.5.3 of the
Language Reference Manual, page 154.

Or you can create an entirely new instance of a package to instantiate
some portion of a generic package.

ie.  => type small_natural is new natural range 1..10;
        package small_natural_io is new   
        ada.text_io.integer_io(small_natural'range);

What you were trying to do in your original example is syntactically
incorrect. If your goal was to create two seperate packages using the
same unit as a base for these, then you should probably look into
generic units.



  reply	other threads:[~2002-02-13 22:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-13 19:48 Package instance??? Yates
2002-02-13 22:25 ` Zach Swanson [this message]
2002-02-13 22:31 ` Jeffrey Carter
2002-02-14  2:28   ` Zach Swanson
2002-02-14 14:32     ` Marin David Condic
2002-02-14  2:04 ` Bobby D. Bryant
2002-02-14  2:54 ` Steve Doiel
2002-02-14 14:41   ` Marin David Condic
2002-02-15  2:13     ` Steve Doiel
2002-02-14 12:48 ` Marc A. Criley
2002-02-14 15:09 ` Yates
2002-02-14 18:12 ` Matthew Heaney
replies disabled

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