TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

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

Print Reply
Sender:
"Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
Date:
Thu, 26 Nov 1998 12:44:00 +0100
Reply-To:
Subject:
MIME-Version:
1.0
Content-Transfer-Encoding:
7bit
Content-Type:
text/plain; charset=us-ascii
Organization:
ELCA Matrix SA
From:
Mats Weber <[log in to unmask]>
Parts/Attachments:
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