From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=BAYES_00,XPRIO autolearn=no autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Custom Storage Pool questions Date: Fri, 15 Oct 2021 17:22:43 -0500 Organization: JSA Research & Innovation Message-ID: References: <86v91ylnft.fsf@stephe-leake.org> Injection-Date: Fri, 15 Oct 2021 22:22:44 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="18106"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:63015 List-Id: "Stephen Leake" wrote in message news:86v91ylnft.fsf@stephe-leake.org... > "Randy Brukardt" writes: > >>> >>> That is OK, but you still have to expand dispatching tables upon loading >>> the library and shrink them upon unloading (though the latter is not >>> supported, I guess). >> >> ??? The dispatching tables are defined statically by the compiler, and >> never >> change. > > It would be nice if different variants of a dynamically loaded library > could introduce different derived types; that would support a "plugin" > model nicely. > > For example, suppose an editor defines a library interface for computing > indent for various languages. Then one variant could provide Ada, > another Pascal, etc. Each could be a derived type. > > I think you are saying this is simply not possible with Ada tagged types. The case Dmitry was talking about (or at least that I thought he was talking about) is deriving a new type from a dynamically loaded type. That can be implemented, but you have to know the type you are deriving from in the Ada model (classwide parents are illegal in Ada). So it doesn't buy a huge amount. You are talking about exposing different implementations of the same Ada type in a dynamically loaded library, and that of course works fine. You can't have truly different types in the Ada model, since you are sharing the specification (essentially, only the body is dynamically loaded; even if the code for the spec is included in the dynamic loaded unit, the static properties have to be the same). Randy.