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,982ed90dd25179ec X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-13 08:37:49 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc51.ops.asp.att.net.POSTED!not-for-mail From: Mark Biggar User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: point by point advantages of Ada References: <1041186672.615164@ns2-ext.dcu.ie> <8EIP9.19113$p_6.1493222@bgtnsc04-news.ops.worldnet.att.net> <24oS9.30853$p_6.2594702@bgtnsc04-news.ops.worldnet.att.net> <3E1B4C4C.7050205@cogeco.ca> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.235.88.213 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc51.ops.asp.att.net 1042475868 12.235.88.213 (Mon, 13 Jan 2003 16:37:48 GMT) NNTP-Posting-Date: Mon, 13 Jan 2003 16:37:48 GMT Organization: AT&T Broadband Date: Mon, 13 Jan 2003 16:37:48 GMT Xref: archiver1.google.com comp.lang.ada:32965 Date: 2003-01-13T16:37:48+00:00 List-Id: Randy Brukardt wrote: > Warren W. Gay VE3WWG wrote in message <3E1B4C4C.7050205@cogeco.ca>... > >>Randy Brukardt wrote: > > >>I thought that this might work: >> >> declare >> V : T'Class := ... >> begin >> ... >> V := Some_Other_Func; - Dispatching >> end; >> >>But GNAT (at least) reports that this assignment is "ambiguous" >>and will not compile it. I would have expected that it would >>resolve it at runtime, knowing the current value of V and its >>current tag. Is this consistent with the LRM (IANAL)? > > > Unfortunately, the LRM has no position on this. This case is not covered > at all by the standard. The ARG has been working (slowly) on an AI to > fix this, and it finally was finished in October and approved at the > recent ARG and WG9 meetings. It's AI-196. > http://www.ada-auth.org/cgi-bin/cvsweb.cgi/AIs/AI-00196.TXT > > The solution is essentially to add a paragraph saying that your example > works as you expect. Now, of course, you'll have to wait for Ada > compilers to conform to this ruling. (Which will be helped when an ACATS > test gets added for it.) This isn't the interesting case anyway. The interesting case is where the function is used as a parameter to another subroutine which has additional dispatching operands. For example: Type Set is tagged ...; function Union(L, R: Set) return Set; function Empty return Set; Type Ordered_Set is new Set with ... ; function Union(L, R: Ordered_Set) return Ordered_Set; function Empty return Ordered_Set; S: Ordered_Set'class := ...; S := Union(S, Empty); Now, which version of Empty is called is determined by run-time dispatch depending of whether S is a Set or an Ordered_Set. -- Mark Biggar mark.a.biggar@attbi.com