From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 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: Lower bounds of Strings Date: Fri, 8 Jan 2021 20:18:06 -0600 Organization: JSA Research & Innovation Message-ID: References: <1cc09f04-98f2-4ef3-ac84-9a9ca5aa3fd5n@googlegroups.com> <37ada5ff-eee7-4082-ad20-3bd65b5a2778n@googlegroups.com> Injection-Date: Sat, 9 Jan 2021 02:18:08 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="27909"; 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; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:61070 List-Id: "Dmitry A. Kazakov" wrote in message news:rtaeok$l8b$1@gioia.aioe.org... > On 2021-01-08 18:23, Shark8 wrote: >> On Thursday, January 7, 2021 at 3:03:54 PM UTC-7, Randy Brukardt wrote: > >>> Any sort of multiple inheritance (not to mention multiple dispatch) >>> requires >>> searching a lookup table for the appropriate interface. >> Ah. >> It appears you're confusing the Ada concept underlying keyword INTERFACE >> with the general/abstract notion. >> It appears to me that Dmitry is referring to the latter, not the >> Ada-construct of INTERFACE, which requires a tagged type. >> >> I think what he's getting at is something that I considered/proposed here >> on C.L.A some years ago, adding the concept of an "ABSTRACT INTERFACE" to >> Ada. (IIRC, the proposal I had in mind was to be able to model the >> notional meta type-hierarchy; eg: Number ? Universal_Integer ? >> System.Integer.) > > Right, though I do not think that tags can inflict any cost. The situation > is same as with array bounds. You do keep bounds when the array is > statically constrained. Tag is just another constraint like bounds. It > must be handled just same way, removed when statically known. No penalty, > unless classes are actually used. I do not know why people always bring > dispatch into discussions about static cases. The possibility of dynamic dispatch (in some code that doesn't exist yet, but *could*) is what is so expensive and is virtually impossible to remove after the fact (that is, in an optimizer). If you wanted to include a declaration that you *never* were going to use any dynamic dispatch, then you could talk try to ignore the possibility. But without some sort of dispatch, a defined interface buys you nothing other than complication. It doesn't simplify the description and would substantially complicate the implementation. What's the point?? Randy.