comp.lang.ada
 help / color / mirror / Atom feed
From: jsa@alexandria (Jon S Anthony)
Subject: Re: Extending A Generic Signature Package
Date: 1997/03/25
Date: 1997-03-25T00:00:00+00:00	[thread overview]
Message-ID: <JSA.97Mar24204636@alexandria> (raw)
In-Reply-To: 5gkv23INN3rn@thalamus.cis.ohio-state.edu


In article <5gvgg0INNj32@snoopy.cis.ohio-state.edu> dgibson@snoopy.cis.ohio-state.edu (david scott gibson) writes:

> In article <JSA.97Mar21200655@alexandria>,
> Jon S Anthony <jsa@alexandria> wrote:
> 
> >> >    declare
> >> >       X : Base'Class := Get_Object;
> >> >    begin
> >> >       Op1(X);
> >> >    end;
> >> 
> >> So in this case it's clear to us and the compiler what specific type
> >> derived from Base Get_Object returns.
> >
> >No, the _specific_ type is unknown until runtime.  But, whatever it
> >is, it will be in Base'Class.
> 
> Hmmm.  I was thinking of Get_Object as a constructor for a specific
> derived type of Base.  Are you're suggesting some non-functional
> behavior here for Get_Object to be able to return any one of several
> specific derived types?

I don't know what you mean by "non-functional behavior".  Certainly,
as you suggest, Get_Object could be a constructor for a specific type
in Base'Class, but I was thinking of a different situation.  Suppose
it returns Base'Class and computes the object of the appropriate
specific type on the fly.  Or perhaps, it dispatches (in which case it
needs a parameter of some sort) to the appropriate specific Get_Object
or some combination of these.  Anyway, you get the idea.


> that this rule only applied to them.  Nevertheless, I assume compilers
> may return tagged types, especially big ones, by reference.  I didn't
> mean to imply that objects passed by reference should be thought of as
> "pointers".  Ada seems to do a good job of making the mechanism
> transparent.  

Bob answered this one.

/Jon
-- 
Jon Anthony
Organon Motives, Inc.
Belmont, MA 02178
617.484.3383
jsa@organon.com





      parent reply	other threads:[~1997-03-25  0:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-03-17  0:00 Extending A Generic Signature Package david scott gibson
1997-03-18  0:00 ` Tucker Taft
1997-03-18  0:00   ` Alexander V. Konstantinou
1997-03-21  0:00     ` Geert Bosch
1997-03-21  0:00       ` Brian Rogoff
1997-03-22  0:00         ` Robert A Duff
1997-03-21  0:00 ` Jon S Anthony
1997-03-21  0:00   ` david scott gibson
1997-03-22  0:00     ` Robert A Duff
1997-03-22  0:00 ` Jon S Anthony
1997-03-21  0:00   ` david scott gibson
1997-03-22  0:00     ` Robert A Duff
1997-03-25  0:00 ` Jon S Anthony [this message]
replies disabled

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