comp.lang.ada
 help / color / mirror / Atom feed
From: "Peter C. Chapin" <pchapin@sover.net>
Subject: Re: Using a generic instance to implement a public subprogram?
Date: Sun, 03 Feb 2008 14:46:23 -0500
Date: 2008-02-03T14:46:23-05:00	[thread overview]
Message-ID: <47a61a1f$0$23713$4d3efbfe@news.sover.net> (raw)
In-Reply-To: <47a615cc$1_4@news.bluewin.ch>

Gautier wrote:


> No idea whether GNAT is right or not, but the following works (I came 
> across the same problem at least one time...):
> 
>    function Sqrt_internal is
>       new Unary_Operation(Operation => Elementary_Functions.Sqrt);
> 
>    function Sqrt(V : Vector) return Vector
>       renames Sqrt_internal;

Cool. I'll give that a try.

> Note that the compilation of your code with ObjectAda 7.2.2 fails too; 
> it says the following:
> "
> check.adb: Error: line 21 col 13 LRM:8.3(26), Illegal to override 
> declaration in same region, Introducing new declaration anyway

So it seems like the instantiation is regarded as a different thing than 
the subprogram mentioned in the specification. Yet because it has the 
same profile as the subprogram in the specification it "conflicts" with 
that earlier declaration. ObjectAda's use of the word "override" seems 
confusing; I don't think this has anything to do with overriding 
primitive operations. Or does it? Hmmm.

Thanks for your suggestion.

Peter



  reply	other threads:[~2008-02-03 19:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-03 18:35 Using a generic instance to implement a public subprogram? Peter C. Chapin
2008-02-03 19:27 ` Gautier
2008-02-03 19:46   ` Peter C. Chapin [this message]
2008-02-03 20:37     ` Dmitry A. Kazakov
2008-02-05  1:58 ` Randy Brukardt
replies disabled

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