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: Tue, 12 Jan 2021 02:19:24 -0600 Organization: JSA Research & Innovation Message-ID: References: <1cc09f04-98f2-4ef3-ac84-9a9ca5aa3fd5n@googlegroups.com> <37ada5ff-eee7-4082-ad20-3bd65b5a2778n@googlegroups.com> Injection-Date: Tue, 12 Jan 2021 08:19:25 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="21866"; 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:61107 List-Id: "Dmitry A. Kazakov" wrote in message news:rtc1vu$1cfj$1@gioia.aioe.org... ... > Of course it will simplify everything. E.g. our beloved generics. Compare > > generic > type I is (<>); > type E is private; > type A is array (I range <>) of E; > > with > > generic > type A is new Root_Array_Type with private; Surely, it simplifies it to uselessness. You haven't declared the index and component types here. And if they are implicit in Root_Array_Type, you've now run into the fundemental problem of interfaces: you need a generic or everything has to be related in order to use an interface. For instance, you can't have a useful container interface because the interface has to somehow contain the element type. The only way to do that is to add additional generics (which is madness), or require all of the elements to be descendants of some root type (which is a different form of madness). Interfaces aren't a free lunch, they just add complexity (or, at best, move it around). One has to look at the entire set of declarations needed, not just one use (it would be a sorry language feature indeed if you couldn't find any example that it simplified!). Randy.