From: Adam Beneschan <adam@irvine.com>
Subject: Re: Cannot implement with an instantiation?!
Date: Thu, 25 Oct 2007 10:41:46 -0700
Date: 2007-10-25T10:41:46-07:00 [thread overview]
Message-ID: <1193334106.176325.278150@q5g2000prf.googlegroups.com> (raw)
In-Reply-To: <1193333646.936502.278310@y42g2000hsy.googlegroups.com>
On Oct 25, 10:34 am, amado.al...@gmail.com wrote:
> Ada is being very bad to me. She does not let me instantiate a generic
> procedure Generic_Connect nested in a generic package body
> Generic_Graphs. Is she in any reason? And how do I make things right?
Renaming-as-body. See below.
> Thanks a lot.
You're welcome!
> generic
> ...
> package Generic_Graphs is
> ...
> procedure Connect
> (Digraph : in out Digraph_Type;
> From, To : Node_Array);
> ...
> end;
>
> package body Generic_Graphs is
> ...
>
> generic
> ...
> procedure Generic_Connect
> (Digraph : in out Digraph_Type;
> From, To : Node_Array);
>
> procedure Generic_Connect
> (Digraph : in out Digraph_Type;
> From, To : Node_Array) is
> begin
> ...
> end;
>
> procedure Connect
> (Digraph : in out Digraph_Type; -- <== GNAT complains here saying
> that a
> From, To : Node_Array) -- formal part is not allowed in
> an instantiation
> is new Generic_Connect (True);
procedure Generic_Connect_Inst is new Generic_Connect (True);
procedure Connect (Digraph : in out Digraph_Type;
From, To : Node_Array)
renames Generic_Connect_Inst;
-- Adam
prev parent reply other threads:[~2007-10-25 17:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-25 17:34 Cannot implement with an instantiation?! amado.alves
2007-10-25 17:41 ` Adam Beneschan [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