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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2fc95e32fd071218 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-25 11:19:03 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: mheaney@on2.com (Matthew Heaney) Newsgroups: comp.lang.ada Subject: Re: Two class-wide operands, but only one controlling Date: 25 Nov 2002 11:19:02 -0800 Organization: http://groups.google.com/ Message-ID: <1ec946d1.0211251119.3399add2@posting.google.com> References: <3ddfa8b8$0$304$bed64819@news.gradwell.net> NNTP-Posting-Host: 66.162.65.162 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1038251943 4913 127.0.0.1 (25 Nov 2002 19:19:03 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 25 Nov 2002 19:19:03 GMT Xref: archiver1.google.com comp.lang.ada:31217 Date: 2002-11-25T19:19:03+00:00 List-Id: porton@ex-code.com (Victor Porton) wrote in message news:<3ddfa8b8$0$304$bed64819@news.gradwell.net>... > I want something like a procedure with two class-wide operands, > (of two different types) but only one of these controlling. > > The solution I found is introducing new tagged record > types which would refer to these two types and passing both > operands as one operand in such the record. Other solutions? No, you don't need two separate types. Just declare the second parameter as type T'Class, e.g. type T is tagged ...; procedure Op (O1 : T; O2 : T'Class); Now procedure Op only dispatches according to the tag of O1. If you want two separate types, then just do this: procedure Op (O1 : T; O2 : T2'Class);