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=0.0 required=3.0 tests=BAYES_20,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:aed:3943:: with SMTP id l61mr5785620qte.392.1611679565683; Tue, 26 Jan 2021 08:46:05 -0800 (PST) X-Received: by 2002:a25:902:: with SMTP id 2mr5161589ybj.303.1611679565449; Tue, 26 Jan 2021 08:46:05 -0800 (PST) Path: eternal-september.org!reader02.eternal-september.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 26 Jan 2021 08:46:05 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=94.31.101.133; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 94.31.101.133 References: <9e1b5d67-be08-4f53-aadc-fbed761a8c24n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6e343937-3590-4944-8c38-10b61014e128n@googlegroups.com> Subject: Re: Simple example on interfaces From: AdaMagica Injection-Date: Tue, 26 Jan 2021 16:46:05 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:61211 List-Id: Dmitry A. Kazakov schrieb am Dienstag, 26. Januar 2021 um 12:53:25 UTC+1: > The problem with generics (static polymorphism which also includes > overloading) is that they answer no to the last question. There cannot > be same program because there is no class-wide (polymorphic) objects > from the generics' class. universal_integer being something like class of all integers, this would be: generic type T is range <>; procedure F (X: T); is replaced by the classwide procedure F (X: universal_integer); -- not Ada universal_integer is anonymous and doesn't have any operations (except automatic conversion). > P.S. Comparing generics to overloading, generics offer some re-use, and > some degree of formalization at the cost of producing huge mess, while > overloading does none. I know you don't like generics. I do not see a huge mess.