TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Classic View

Use Monospaced Font
Show HTML Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Mats Weber <[log in to unmask]>
Thu, 26 Nov 1998 12:44:00 +0100
text/plain (18 lines)
"Robert I. Eachus" wrote:

>    Note that the "is <>;" default on formal generic subprograms is the one
> instance of run-time polymorphism in Ada 83, although I would never
> recommend using it just to obtain that effect. The run-time elaboration of
> "is <>" is more of a pain for compiler vendors than anything else:
> Generics are instantiated at run-time, and "is <>" matches the matching
> subprogram statically enclosing the point of instantiation. (See RM
> 12.6(15).)  It is always possible to figure out the (static) parameter and
> result profile to be matched for every textual generic instantiation at
> compile time, and which delaration will correspond to it.  But it can be
> the case that the actual subprogram created by that text to be called
> cannot be determined until run-time.  In particular, the default parameter
> values may not be known until the instantiation is elaborated.

Could you please give an example of that (determination of the generic
actual subprogram cannot be done at compile time) ?

ATOM RSS1 RSS2