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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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 16:27:45 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!snoopy.risq.qc.ca!newsfeed.news2me.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!not-for-mail From: Richard Riehle Newsgroups: comp.lang.ada Subject: Re: point by point advantages of Ada Date: Tue, 07 Jan 2003 16:36:41 -0800 Organization: AdaWorks Software Engineering Message-ID: <3E1B7298.6E29EB8B@adaworks.com> 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> Reply-To: richard@adaworks.com NNTP-Posting-Host: 41.b2.61.0e Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 8 Jan 2003 00:27:44 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:32711 Date: 2003-01-08T00:27:44+00:00 List-Id: "Warren W. Gay VE3WWG" 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)? I am not sure if you have tried this, but I often create a function such as, function Get ( ... ) return T'Class; Then, I initialize the declaration with V : T'Class := Get (... ); where the parameter list might be the name of a data structure, a file, or even a simple array along with the next index. This works really well in solving a lot of problems with dispatching. Richard Riehle