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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c84654714c2f5945 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!proxad.net!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: GNAT GPL Edition - on the plus side Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1u927xnbmsfw1$.1xg4jk31952ts$.dlg@40tude.net> Date: Sun, 16 Oct 2005 11:56:02 +0200 Message-ID: <151ce985k0gjv.dzrvw8gwlx27.dlg@40tude.net> NNTP-Posting-Date: 16 Oct 2005 11:56:01 MEST NNTP-Posting-Host: a91eb8f2.newsread2.arcor-online.net X-Trace: DXC=CEFVRGcHfaOUhhl_USDNiOQ5U85hF6f;DjW\KbG]kaMHQ>n?D9BSA]LM?o2ST] On 15 Oct 2005 20:48:29 -0400, Robert A Duff wrote: > "Dmitry A. Kazakov" writes: > >> I am not sure I have understood what you meant,... > > From your response, I think you understand exactly what I meant. You > propose passing type parameters to (generic) types as opposed to passing > type parameters to (generic) packages. Yes, that's a lot like > discriminants, and I've thought of the same thing myself. > > But it's still a lot like generics -- instead of generic packages, we > have generic types. (In fact, in Eiffel, you have generic classes.) [ Parametric types, Ada has them since its first day, they aren't "instead". ] > I don't much like the macro-expansion-like semantics of Ada generics > (though it's better in some ways than C++ templates). The need is for > "types parameterized by types". Ada generics do that, and perhaps some > magical discriminants could, too, and perhaps that would be more > convenient. > > Are we agreeing or disagreeing, here? Yes we are. Though to expand on it a bit, the problem as I see it, is not in what generics do, but in how they do it and what they are. The root of evil in generics is not even clumsy syntax, unintelligible error messages, geometric explosion of instances and formal parameters, name space pollution etc. It is that the generic entity is not a proper object. Only its instance is. You cannot do anything with a set of different instances of the *same* generic. What makes OOP so attractive, though it might be far more limited than generics, is that you can have T'Class. This pays off all! -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de