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=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada Successor Language Date: Fri, 22 Jun 2018 18:02:08 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <5e86db65-84b9-4b5b-9aea-427a658b5ae7@googlegroups.com> <878t7u1cfm.fsf@nightsong.com> <776f3645-ed0c-4118-9b4d-21660e3bba4b@googlegroups.com> <87602fbu2g.fsf@nightsong.com> <87po0mziqt.fsf@nightsong.com> <30e271d8-0ef9-4986-8726-2b09c7fb9526@googlegroups.com> NNTP-Posting-Host: 3CrKQyqWAJZHy6zYVP/kUg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 X-Notice: Filtered by postfilter v. 0.8.3 X-Mozilla-News-Host: news://news.aioe.org Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:53255 Date: 2018-06-22T18:02:08+02:00 List-Id: On 2018-06-22 13:13, Alejandro R. Mosteo wrote: > On 20/06/2018 09:33, Dmitry A. Kazakov wrote: > >> I you meant rather *types*, then as I said earlier, polymorphism can >> be achieved by different means and ad-hoc polymorphism offered by >> generics the worst possible way. My point was to use dynamic >> polymorphism instead. > > Is something interfaces-like what you mean here? Sure. Especially when ad-hoc superclasses are needed. There is no way to foresee and declare all possible interfaces of a type. One should be able to declare a common interface ancestor later on. > I admit I still have > sometimes the doubt of doing things the generic vs interface way. Generics are automatically at disadvantage, even performance-wise, because in all contexts where types are statically known there is no dispatch in Ada. Since generics are always static in all comparable cases dynamically polymorphic calls are statically resolved. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de