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,c6150ba97747373e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-18 03:29:49 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!dialin-145-254-038-153.arcor-ip.NET!not-for-mail From: Dmitry A.Kazakov Newsgroups: comp.lang.ada Subject: RE: runtine instanciation Date: Wed, 19 Jun 2002 00:35:09 +0200 Message-ID: References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-038-153.arcor-ip.net (145.254.38.153) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: fu-berlin.de 1024396189 8649372 145.254.38.153 (16 [77047]) User-Agent: KNode/0.4 Xref: archiver1.google.com comp.lang.ada:26223 Date: 2002-06-19T00:35:09+02:00 List-Id: 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