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-Thread: 103376,33ed4ca582c945fc X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!feed.xsnews.nl!border-3.ams.xsnews.nl!eweka.nl!lightspeed.eweka.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!newsgate.cistron.nl!xs4all!news.wiretrip.org!border1.nntp.ams.giganews.com!nntp.giganews.com!transit5.hitnews.eu!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Limited returns Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <304d62f5-53eb-4ec2-bcd5-a84ac8f9fe60@m44g2000hsc.googlegroups.com> <3pwjng4q8sde.mh4dkauvjpxt.dlg@40tude.net> <1j69b9rfwxyan$.y9ghhug4gy9m.dlg@40tude.net> Date: Tue, 24 Jun 2008 18:31:12 +0200 Message-ID: <1f9ac6udt63fj.1fsvjy8pyqbsp$.dlg@40tude.net> NNTP-Posting-Date: 24 Jun 2008 18:31:14 CEST NNTP-Posting-Host: 6216bbf3.newsspool1.arcor-online.net X-Trace: DXC=82W_F=dW\G[YI9]OHn9o5^ic==]BZ:af^4Fo<]lROoRQ<`=YMgDjhgRb5FMY:UF6[W[6LHn;2LCV^[ On Tue, 24 Jun 2008 08:01:01 -0700 (PDT), fedya_fedyakoff@inbox.ru wrote: >>Because of a compiler bug, I guess. I think you should post it. > > unfortunately too match bugs. Ada 2005 introduced stuff [e.g. limited returns], which is quite hard to implement (or merely to understand, if I dare say this (:-)). AdaCore is working hard on this. It takes time until the dust settles down... ------------------------ As a side note. The thing you are doing is quite rare. Normally nobody would assign class-wide objects. There is virtually just one case where you would need to copy (but not to overwrite!) a class-wide object: declare X : T'Class := Get_From_The_Outside_World; begin ... -- Do something with X or procedure Queue (X : T'Class) is begin Append (List, new T'Class (X)); -- Create a copy and marshal it Beyond this, class-wide objects are never assigned in the sense that you would replace one class-wide value with another. It just cannot work properly from the OO perspective because there is no static guaranty that the specific would match. If there is one, then you know the types and then you have to specify them. So at least it would be bad design. Remember that assignment is doubly dispatching. Double dispatch is not supported in Ada. Ergo, don't do that. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de