comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Universal type
Date: Sat, 4 Aug 2007 09:21:52 +0200
Date: 2007-08-04T09:21:42+02:00	[thread overview]
Message-ID: <ngv4wz9nqbcg$.8iwgz46uk8ft.dlg@40tude.net> (raw)
In-Reply-To: 1186173305.970431.205500@g4g2000hsf.googlegroups.com

On Fri, 03 Aug 2007 13:35:05 -0700, Maciej Sobczak wrote:

> My answer to the above question: Java people added generics and (more
> or less) typesafe collections for a reason - their initial idea of
> storing anything in a single collection didn't please even themselves.

Java people added generics because it was fashionable at that time.
Generics or not, the problem stays. The set of types in the class of the
list items does not have common methods.

Here class = the set of all types an item of *the* list may have. Note that
generics change here absolutely nothing to better:

generic
   type Item is ...
package Generic_Container is

Each instance of this package has exactly one type of items => all items of
a list have *same* type.

Generics provide one polymorphic implementation for lists of many types,
but that does not make lists themselves polymorphic. Don't mix a macro and
its expansions. (:-))

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  parent reply	other threads:[~2007-08-04  7:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-03 18:28 Universal type shaunpatterson
2007-08-03 18:31 ` shaunpatterson
2007-08-03 19:10   ` Dmitry A. Kazakov
2007-08-03 20:35     ` Maciej Sobczak
2007-08-03 21:54       ` shaunpatterson
2007-08-04  1:10         ` Jeffrey R. Carter
2007-08-04  7:21       ` Dmitry A. Kazakov [this message]
2007-08-03 23:03 ` Georg Bauhaus
2007-08-05 13:46 ` Martin Krischik
replies disabled

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