comp.lang.ada
 help / color / mirror / Atom feed
From: Keean Schupke <keean.schupke@googlemail.com>
Subject: Re: Signature Package With Generic Proceedure
Date: Mon, 23 Jul 2012 11:36:58 -0700 (PDT)
Date: 2012-07-23T11:36:58-07:00	[thread overview]
Message-ID: <e815cf1d-eead-4130-8eed-5dd7a8f19e6a@googlegroups.com> (raw)
In-Reply-To: <m21uk2sric.fsf@nidhoggr.home>

On Monday, 23 July 2012 11:26:03 UTC+1, Simon Wright  wrote:
> Keean Schupke writes:
> 
> &gt; If I have a package which defines a procedure like:
> &gt;
> &gt;
> &gt; generic
> &gt;     with procedure Process(Set : in out Set_Type);
> &gt; procedure Update(Set : in out Set_Type);
> &gt;
> &gt;
> &gt; How do a declare a Signature package that includes this?
> &gt;
> &gt;
> &gt; generic
> &gt;     with generic
> &gt;         with procedure Process(Set : in out Set_Type);
> &gt;     procedure Update(Set : in out Set_Type);
> &gt; package Set_Signature is end;
> &gt;
> &gt;
> &gt; Is not allowed. Is there some way to do this with nested packages?
> 
> I guess you meant to say
> 
>    generic
>        type Set_Type is limited private;
>        ...
>        with generic
>            with procedure Process(Set : in out Set_Type);
>        procedure Update(Set : in out Set_Type);
>        ...
>    package Set_Signature is end;
> 
> ? in which case I don&#39;t see why you couldn&#39;t say
> 
>    generic
>        type Set_Type is limited private;
>        ...
>        with procedure Update(Set : in out Set_Type);
>        ...
>    package Set_Signature is end;
> 
> Seems to me that all you need is for the actual Update to have that
> profile, who cares how it got that way?
> 
> I&#39;ve probably misunderstood this. Could maybe child units help?
> 
>    generic
>       with procedure Process (Set : in out Set_Type);
>    procedure Set_Signature.Update (Set : in out Set_Type);

The Signature package defines the interface, so if the procedure in the signature is not generic, you could not instantiate it with the 'process' procedure you want to use.

Basically a signature package is like the first part of a package that has no body, and you bind it to another package later that actually provides the body.


Cheers,
Keean.



      reply	other threads:[~2012-07-26 15:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <045f7b44-2a4a-4292-80fd-0b6bc8ee3465@googlegroups.com>
2012-07-21 22:22 ` Signature Package With Generic Proceedure Adam Beneschan
2012-07-22  7:28   ` Dmitry A. Kazakov
2012-07-22 16:22   ` Keean Schupke
2012-07-23  0:45     ` Adam Beneschan
     [not found]       ` <79925d0c-b2dd-44a3-9451-48f0ee19485f@googlegroups.com>
     [not found]         ` <500d3a9d$0$6566$9b4e6d93@newsspool4.arcor-online.net>
2012-07-23 18:29           ` Keean Schupke
     [not found]         ` <ac8bfaed-dbcc-491a-a760-c25672445eef@googlegroups.com>
2012-07-23 19:41           ` Keean Schupke
2012-07-24  2:57         ` Randy Brukardt
     [not found]         ` <jul2n4$af5$1@munin.nbi.dk>
2012-07-24  8:02           ` Keean Schupke
2012-07-24  8:43             ` Dmitry A. Kazakov
2012-07-24  8:59               ` Keean Schupke
2012-07-23 10:26 ` Simon Wright
2012-07-23 18:36   ` Keean Schupke [this message]
replies disabled

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