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 X-Received: by 2002:a6b:964c:: with SMTP id y73-v6mr580889iod.106.1527965013711; Sat, 02 Jun 2018 11:43:33 -0700 (PDT) X-Received: by 2002:a9d:5608:: with SMTP id e8-v6mr189104oti.5.1527965013592; Sat, 02 Jun 2018 11:43:33 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!newsreader5.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.am4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!u74-v6no3392352itb.0!news-out.google.com!b185-v6ni3718itb.0!nntp.google.com!v8-v6no3380781itc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 2 Jun 2018 11:43:33 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=47.185.233.194; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 47.185.233.194 References: <795d1d54-0868-4745-8132-b38165494f39@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9fa93d0f-30d2-4c79-b0ef-f94d96862da2@googlegroups.com> Subject: Re: Using interfaces From: "Dan'l Miller" Injection-Date: Sat, 02 Jun 2018 18:43:33 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 4380 X-Received-Body-CRC: 2068626363 Xref: reader02.eternal-september.org comp.lang.ada:52861 Date: 2018-06-02T11:43:33-07:00 List-Id: On Saturday, June 2, 2018 at 12:22:09 PM UTC-5, Jeffrey R. Carter wrote: > On 06/02/2018 05:20 PM, Gautier Niouzes wrote: > > Hello, > > I am developing a package for displaying some kinds of figures on an op= en set of devices. I'm trying to > > use interfaces for that. If you are yearning for multiple dispatch, then it could conceivably be ach= ieved in modern Ada the way that single-dispatch OO was described for Ada83= : http://home.pipeline.com/~hbaker1/OOAdaLetters.html Or you could hack multimethods into a forked GNAT. The primary annoyance i= s how best to achieve a multidimensional look-up based on a coordinate of 2= or more tags, e.g., in O(1) time and O(mn=E1=B5=8F) space(-per-executable/= DLL) would be the multidimensional-array implementation (instead of today's= single-dimensional tag-based array), where m is the quantity of tagged rec= ords, n is the quantity of densely-type-dispatched multimethods per tagged = record, and k is the degree of mult- in multimethods/multiple-dispatch. k= =3D2 is called double dispatch. k=3D3 is called triple dispatch. and so fo= rth A secondary annoyance is erroring out at compile-time if the program has an= y sparseness whatsoever in that multidimensional array (i.e., forgot to dec= lare a multimethod for some combination of 'Classes). > "IMHO, Interfaces are worthless." > Randy Brukardt >=20 > He usually knows what he's talking about. Ummmmm. I suspect that Randy's statement neither started nor ended there. = Instead of being in =E2=80=98a pox on all their houses=E2=80=99 and =E2=80= =98the horse they rode in on=E2=80=99 mode, I suspect that Randy in the ver= y next sentence or paragraph said that language-construct X instead better = accomplishes what =E2=80=98interface=E2=80=99-keyword constructs seek to do= . For example, in many modern programming languages, Ada included, there is a= natural tension between the OO feature-set and the generic/parameterized-t= ypes feature-set as 2 nearly duplicated ways of accomplishing analogous goa= ls. Of course this is because runtime/tagged-record polymorphism and param= etric/generic polymorphism are 2 forms of polymorphism at different vertexe= s on the lambda cube. https://en.wikipedia.org/wiki/Lambda_cube > "C++ is like giving an AK-47 to a monk, shooting him=20 > full of crack and letting him loose in a mall and=20 > expecting him to balance your checking account=20 > 'when he has the time.'" I would say that modern C++ is like giving the template engine Turing compl= eteness with a syntax that is only slightly more readable than a Turing-mac= hine's infinite-length tape and then making the entire reason for the langu= age to exist to constantly put bandages on the never-quite-healing wounds i= nflicted by the Turing-completeness-in-the-template-engine bull goring the = rest of the C++ language with its horns, as if the rest of the language is = a porcelain shop that stocks only red items. Oh wait. No =E2=80=9Clike=E2= =80=9D about it; that is what really happened.