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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8054919d7e55838b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!v46g2000cwv.googlegroups.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada Subject: Re: Q: Hiding the structure of a tagged type using containers Date: 9 May 2006 07:52:00 -0700 Organization: http://groups.google.com Message-ID: <1147186320.100422.245170@v46g2000cwv.googlegroups.com> References: <1147139575.425825.290860@u72g2000cwu.googlegroups.com> NNTP-Posting-Host: 66.162.65.129 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1147186326 21151 127.0.0.1 (9 May 2006 14:52:06 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 9 May 2006 14:52:06 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: v46g2000cwv.googlegroups.com; posting-host=66.162.65.129; posting-account=Zl1UPAwAAADEsUSm1PMMiDjihtBlZUi_ Xref: g2news2.google.com comp.lang.ada:4155 Date: 2006-05-09T07:52:00-07:00 List-Id: Stephen Leake wrote: > brian.b.mcguinness@lmco.com writes: > > > The general solution to this error is to make one of the arguments > class-wide; in this case: > > procedure Shape > (A : in APL_Array_Dimensioned; Dimensions : out APL_Shape'class); This won't work, since the APL_Shape isn't tagged at the point where Shape is declared. > Another solution is to use only one tagged type. Apparently > APL_Dimension_List.Vector is visibly tagged; perhaps it does not need > to be? We debated this during the design of the container library, and concluded that we might as well make the type tagged, since the most likely implementation would be that container types privately derive from Controlled. Making the container types publicly tagged then gives you other benefits such as as implicit aliasing of subprogram parameters and distinguished-receiver syntax. The solution in this case is to implement the full view of type APL_Shape as a non-tagged record, with a vector component. -Matt