comp.lang.ada
 help / color / mirror / Atom feed
From: "Marc A. Criley" <mcqnet@earthlink.net>
Subject: Re: generic packages and dispatched operations
Date: Wed, 28 Feb 2001 13:19:15 GMT
Date: 2001-02-28T13:19:15+00:00	[thread overview]
Message-ID: <3A9CED0D.5C514170@earthlink.net> (raw)
In-Reply-To: 97gmv4$3cf$1@a1-hrz.uni-duisburg.de

Georg Bauhaus wrote:

>      4. package CUpper is new Upper(Character);
>         |
>         >>> warning: instantiation of "upper" may raise Program_Error
>         >>> warning: missing pragma Elaborate_All for "upper"
> 
> Don't rely on what I say, but cupper.ads looks like
> a package spec (at least that is what gnatchop says)
> but is just an instantiation, "new Upper(Character)".
> Checking with the syntax given in RM 7.1(3) I'm missing
> the "end", e.g..
> 
> So, with warnings on, you get more than a silent
> compilation and some hints.   Still I'm not sure
> wether the code is correct.  More votes?
> 

No need to vote, here's the facts:  A stand-alone instantiation is a
perfectly legal Ada unit.  For example, here's the entirety of the
predefined Ada.Integer_Text_IO unit:

---------------------------------------------
with Ada.Text_IO;

package Ada.Integer_Text_IO is
  new Ada.Text_IO.Integer_IO (Integer);
---------------------------------------------

As a matter of fact, even a "package renaming" is a legal unit--here's
Text_IO:

---------------------------------------------
with Ada.Text_IO;

package Text_IO renames Ada.Text_IO;
---------------------------------------------


Marc A. Criley
Senior Staff Engineer
Quadrus Corporation
www.quadruscorp.com



  parent reply	other threads:[~2001-02-28 13:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <96r871$1g5g$1@news.kiev.sovam.com>
2001-02-21  7:17 ` generic packages and dispatched operations Maxim Reznik
2001-02-21 15:00   ` Marin David Condic
     [not found]     ` <972rh2$26gk$1@news.kiev.sovam.com>
     [not found]       ` <97gmv4$3cf$1@a1-hrz.uni-duisburg.de>
2001-02-28 13:19         ` Marc A. Criley [this message]
2001-02-28 14:01       ` Tucker Taft
2001-03-02 12:31         ` Maxim Reznik
replies disabled

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