From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,acb50cdf95d3e13c X-Google-Attributes: gid103376,public From: dgibson@snoopy.cis.ohio-state.edu (david scott gibson) Subject: Re: Extending A Generic Signature Package Date: 1997/03/21 Message-ID: <5gvgg0INNj32@snoopy.cis.ohio-state.edu>#1/1 X-Deja-AN: 227410415 References: <5gkv23INN3rn@thalamus.cis.ohio-state.edu> <5guuehINN6iq@thalamus.cis.ohio-state.edu> Organization: The Ohio State University, Department of Computer and Information Science Newsgroups: comp.lang.ada Date: 1997-03-21T00:00:00+00:00 List-Id: In article , Jon S Anthony 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? >Ah. This is something that many people trip over: an access object >(or "pointer") is not the same thing as an object that happens to be >passed by reference. Also, tagged types are not necessarily return by >reference types (_limited_ tagged types are: see 6.5(11)). Okay, I've primarily been using limited tagged types lately and forgot 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. Dave -- dgibson@cis.ohio-state.edu