comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Limited returns
Date: Tue, 24 Jun 2008 18:31:12 +0200
Date: 2008-06-24T18:31:14+02:00	[thread overview]
Message-ID: <1f9ac6udt63fj.1fsvjy8pyqbsp$.dlg@40tude.net> (raw)
In-Reply-To: ee8a3c7c-7e46-4397-a0d5-3fc3cb399b52@m36g2000hse.googlegroups.com

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



  reply	other threads:[~2008-06-24 16:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-23 14:21 Limited returns Dmitry A. Kazakov
2008-06-23 15:04 ` fedya_fedyakoff
2008-06-23 15:20   ` fedya_fedyakoff
2008-06-23 16:53     ` Dmitry A. Kazakov
2008-06-24 10:56       ` fedya_fedyakoff
2008-06-24 13:51         ` Dmitry A. Kazakov
2008-06-24 15:01           ` fedya_fedyakoff
2008-06-24 16:31             ` Dmitry A. Kazakov [this message]
2008-06-24 16:42               ` Dmitry A. Kazakov
2008-06-23 15:49   ` Adam Beneschan
2008-06-24 10:13     ` fedya_fedyakoff
2008-06-23 15:15 ` Adam Beneschan
2008-06-23 17:03   ` Dmitry A. Kazakov
2008-06-23 18:15     ` Adam Beneschan
2008-06-23 19:44       ` Dmitry A. Kazakov
2008-06-26 12:35 ` Egil Høvik
2008-06-26 14:12   ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox