comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Problem with instantiating generic procedure
Date: 1999/07/19
Date: 1999-07-19T00:00:00+00:00	[thread overview]
Message-ID: <7mtt6e$ec0$1@nnrp1.deja.com> (raw)
In-Reply-To: m3so6mdw05.fsf@deneb.cygnus.stuttgart.netsurf.de

In article <m3so6mdw05.fsf@deneb.cygnus.stuttgart.netsurf.de>,
  Florian Weimer <fw@s.netic.de> wrote:
> From my limited point of view, I don't see it either.
>
> There's a related thing I'd like to see improved in a future
Ada
> revision: pragma Import requires the use of renaming
declarations as
> well if the Ada functions in question are overloaded.  The
effects are
> quite similar here (namespace pollution).

But the name space pollution is a minimal problem, because it
occurs only in private parts or in package bodies, not in
package specs.

We did discuss the possibility of completing subprogram
declarations with generic instantiations, but it was considered
too much machinery for too little gain.

Remember this is just syntactic sugar for defining a body which
does the instantiation internally and then calls the procedure.
In practice, this is the way it would be implemented in any
case.

I would guess this is in practice of minimal importance. In all
the use of GNAT so far, this issue has never come up, so it is
certainly not something that many people expect to be there!

As for pragma Import, the renaminings can all be done in the
private part, so this is not really a burden:

package p is
   procedure q;
   procedure q (x : integer);
private
   procedure q_no_args renames q;
   procedure q_int_arg (x : integer) renames q;

   pragma Import (C, q_no_args);
   pragma Import (C, q_int_arg);

end p;

Indeed, since you need separate names for the routines that
implement these two cases, forcing names to be used in this
way can actually make things clearer!

>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




  reply	other threads:[~1999-07-19  0:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-17  0:00 Problem with instantiating generic procedure Markus Kuhn
1999-07-17  0:00 ` Florian Weimer
1999-07-18  0:00   ` Markus Kuhn
1999-07-18  0:00     ` Chad R. Meiners
1999-07-18  0:00     ` Florian Weimer
1999-07-19  0:00       ` Robert Dewar [this message]
1999-07-19  0:00         ` Florian Weimer
1999-07-17  0:00 ` Vladimir Olensky
1999-07-18  0:00 ` David C. Hoos, Sr.
1999-07-19  0:00 ` Tucker Taft
1999-07-19  0:00   ` Markus Kuhn
1999-07-23  0:00     ` Tucker Taft
1999-07-19  0:00 ` Robert A Duff
replies disabled

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