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@thalamus.cis.ohio-state.edu (david scott gibson) Subject: Re: Extending A Generic Signature Package Date: 1997/03/21 Message-ID: <5guuehINN6iq@thalamus.cis.ohio-state.edu>#1/1 X-Deja-AN: 227359944 References: <5gkv23INN3rn@thalamus.cis.ohio-state.edu> <5gn90o$gm1@sutton.cs.columbia.edu> <5gtvbv$1nj@pandora.cs.utwente.nl> 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: >Just to be clear, "pointers" are only indirectly relevant to >dispatching. The key is passing a class wide type argument(s) to a >controlling operand(s) of a primitive operation. For example, there >is no need of a pointer in your above example: > > 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. It may or may not be an access type. If an access type, Op1 could have an access parameter formal and still dispatch. However, Get_Object must return a tagged type and thus the value returned must be returned by reference in either case, right? So whether explicit or not X, the value of X must be a pointer to some object. Is that right? If Get_Object doesn't return an acces type and we don't use Unchecked_Access or aliased variables anywhere in the program, does Ada guarantee that the object to which X points cannot be aliased? Dave -- dgibson@cis.ohio-state.edu