comp.lang.ada
 help / color / mirror / Atom feed
From: stt@henning.camb.inmet.com (Tucker Taft)
Subject: Re: [Q]: Generic subprogram instantiation
Date: 1996/07/11
Date: 1996-07-11T00:00:00+00:00	[thread overview]
Message-ID: <DuDzvD.JwK.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: Du4vL2.A14@world.std.com


Robert A Duff (bobduff@world.std.com) wrote:
: In article <m-bartz-0507961333140001@macgalois.ee.memst.edu>,
: Michael Bartz <m-bartz@memphis.edu> wrote:
: >        procedure sub_main is new sub_main(galois);
:                    ^^^^^^^^ 1      ^^^^^^^^ 2

: The sub_main at 1 hides the outer sub_main, which you then illegally try
: to reference at 2.  Call the procedure something different from the
: generic.  (Note that generic procedures are NOT overloadable, unlike
: procedures.)

I hate to disagree with both Bob and Robert, but the procedure named
"sub_main" is not introduced until *after* the generic instantiation
in Ada 95.  See RM95 8.2(2):

   ... except in the case of an overloadable declaration [like the above],
   in which case the immediate scope starts just after the place where the
   profile of the callable entity is determined (which is at the end of the
   _specification for the callable entity, or at the end of the 
   generic_instantiation if an instance).

So I believe this line should be accepted.

: - Bob

-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Cambridge, MA  USA




  reply	other threads:[~1996-07-11  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-05  0:00 [Q]: Generic subprogram instantiation Michael Bartz
1996-07-06  0:00 ` Robert Dewar
1996-07-06  0:00 ` Robert A Duff
1996-07-11  0:00   ` Tucker Taft [this message]
1996-07-11  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