From: Dmitry A.Kazakov <mailbox@dmitry-kazakov.de>
Subject: RE: runtine instanciation
Date: Wed, 19 Jun 2002 00:35:09 +0200
Date: 2002-06-19T00:35:09+02:00 [thread overview]
Message-ID: <aen22s$87uks$1@ID-77047.news.dfncis.de> (raw)
In-Reply-To: mailman.1024325702.27478.comp.lang.ada@ada.eu.org
Robert C. Leif wrote:
> From: Bob Leif
> To: Dmitry Kazakov et al.
> 1) I do not believe that sacrificing the reliability of the entire
> program by switching to SmallTalk is a reasonable solution.
It was just a joke, sorry. (:-))
> 2) Even if I create a tagged type for my record, I still have to fill
> its fields. As I previously stated, the allowable data types and their
> methods have been previously compiled. I realize that one could use
> access types. However, I am hoping for a very simple static solution
> based on the use of the compiler. I believe that this is now well within
> the capabilities of the combination of modern Ada compilers and our PCs,
> which now have capabilities well beyond those envisaged by the original
> creators and users of Ada. I ran RR on an 8088 based 4.88 megahertz PC
> with I believe 256 K of RAM. I now, in order to run COTs products, have
> a computer with half a Gig of RAM and a 1.6 Gigahertz CPU. The bus width
> has now been expanded from 1 to 4 or 8 bytes. I suspect that the linker
> technology is the part that may have to be modified.
In your example types are known, so at least theoretically there is no need
to do anything dynamically. Robert Eacus showed that in his post.
But if you really-really want full sized dynamic instantiations etc, you
must in the first place allow things like:
type X is tagged ...;
procedure Foo (A : X);
...
declare
type Y is new X with ...; -- New derived type
procedure Foo (A : Y) is ... -- Overrides X's Foo
begin
...
end;
-- All side effects gone
It is not easy to do. You must dynamically modify dispatch tables and other
internal structures (Ada.Tags.Internal_Tag). There would be utterly nasty
things:
type X is tagged ...;
type X_Ptr is access all X'Class;
procedure Foo (A : X);
...
declare
Nasty : X_Ptr;
begin
declare
type Y is new X with ...;
procedure Foo (A : Y) is ...
begin
Nasty := new Y;
end;
Foo (Nasty.all); -- Oops!
end;
I'd liked to have that, but how to avoid all possible pitfalls?
--
Regards,
Dmitry Kazakov
www.dmitry-kazakov.de
next prev parent reply other threads:[~2002-06-18 22:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-15 11:43 runtine instanciation Immanuel Scholz
2002-06-15 15:20 ` Simon Wright
2002-06-16 23:07 ` Dmitry A.Kazakov
2002-06-17 3:16 ` Robert C. Leif
2002-06-17 22:04 ` Dmitry A.Kazakov
2002-06-17 14:54 ` Robert C. Leif
2002-06-17 21:16 ` Robert I. Eachus
2002-06-18 22:35 ` Dmitry A.Kazakov [this message]
2002-06-17 10:07 ` Antonio Duran
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox