comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: GNAT GPL Edition - on the plus side
Date: Sun, 16 Oct 2005 11:56:02 +0200
Date: 2005-10-16T11:56:01+02:00	[thread overview]
Message-ID: <151ce985k0gjv.dzrvw8gwlx27.dlg@40tude.net> (raw)
In-Reply-To: wcc8xwuguci.fsf@shell01.TheWorld.com

On 15 Oct 2005 20:48:29 -0400, Robert A Duff wrote:

> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> 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



  reply	other threads:[~2005-10-16  9:56 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-14  1:41 GNAT GPL Edition - on the plus side Steve
2005-10-14  4:44 ` randomm
2005-10-14 10:12   ` Alex R. Mosteo
2005-10-14 10:37     ` Martin Dowie
2005-10-19  6:06   ` jussij
2005-10-14  5:55 ` Simon Wright
2005-10-14  8:10 ` Dmitry A. Kazakov
2005-10-14  9:36   ` Martin Dowie
2005-10-14 13:13   ` Marc A. Criley
2005-10-14 17:12     ` Dmitry A. Kazakov
2005-10-14 19:05       ` Georg Bauhaus
2005-10-15  9:28         ` Dmitry A. Kazakov
2005-10-15  0:00       ` Randy Brukardt
2005-10-15 14:45         ` Robert A Duff
2005-10-15 16:14           ` Dmitry A. Kazakov
2005-10-16  0:48             ` Robert A Duff
2005-10-16  9:56               ` Dmitry A. Kazakov [this message]
2005-10-14 13:50   ` Steve
2005-10-14 17:25     ` Dmitry A. Kazakov
2005-10-14 18:58       ` Georg Bauhaus
2005-10-15  9:31         ` Dmitry A. Kazakov
2005-10-15  1:45       ` Steve
2005-10-15 11:18         ` Simon Wright
2005-10-14 17:42   ` Pascal Obry
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox