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,LOTS_OF_MONEY 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-07 13:56:08 PST Message-ID: <3E1B4C4C.7050205@cogeco.ca> From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 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> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 07 Jan 2003 16:53:16 -0500 NNTP-Posting-Host: 198.96.47.195 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1041976398 198.96.47.195 (Tue, 07 Jan 2003 16:53:18 EST) NNTP-Posting-Date: Tue, 07 Jan 2003 16:53:18 EST Organization: Bell Sympatico Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!torn!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Xref: archiver1.google.com comp.lang.ada:32707 Date: 2003-01-07T16:53:16-05:00 List-Id: Randy Brukardt wrote: > James S. Rogers wrote in message ... > >>"David Thompson" wrote in message >>news:24oS9.30853$p_6.2594702@bgtnsc04-news.ops.worldnet.att.net... >> >>>Ada uses return type to resolve overloading (at compile time), but >>>not to dispatch (possibly at run time). (C++ and Java do neither.) >> >>Quoting from "Ada as a Second Language" by Cohen: >>"If a primitive function of a type T has a result of type T, but no > > parameters > >>of type T or access T, a call on the function can be either > > nondispatching or > >>dispatching depending on the context." >> >>This is clearly more than simple overload resolution. > > But it's not quite dispatching on the tag of the result (which you can't > know). But it is dispatching on the tag of result that you need. Here is > a quick example of it: 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)? -- Warren W. Gay VE3WWG http://home.cogeco.ca/~ve3wwg