🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #3334

Re: CHALLENGE: heterogeneous collections

#3334
From: David S. Masterson
Date: Tue, 02 Apr 1991 06:47
55 lines
3313 bytes
>>>>> On 30 Mar 91 01:41:37 GMT, bertrand@eiffel.UUCP (Bertrand Meyer) said:

> From <CIMSHOP!DAVIDM.91Mar28192651@uunet.UU.NET> by
> cimshop!davidm@uunet.UU.NET (David S. Masterson):

> [Quoting from my earlier posting:]

>   >> To handle heterogeneous collections without endangering static
>   >> typing, use genericity (Eiffel syntax):

>   >>       class COLLECTION [G] ...

> [Mr. Masterson's reply:]

>   > Is this a heterogeneous collection (one collection object
>   > containing many objects of many types) or a generic collection
>   > class (a collection class that may be defined to contain any
>   > *single* type of object [which may have multiple parent types])?

> Although this is probably clear to most people reading this newsgroup,
> it may be worth confirming that the collection described by the above
> COLLECTION class is indeed heterogeneous (if so desired by
> clients).

I really hate the idea of contradicting Bertrand Meyer as I'm probably getting
in over my head.  However, I think there is a point that is being missed (and
I'm probably the one missing it).  I believe the original poster was looking
for a use for a *truly* heterogeneous collection.  From Mr. Meyer's
description of COLLECTION (I don't know Eiffel), it still seems that this is
more of a generic collection class in that all objects that can be contained
in the collection are related through some (base) type and, therefore, follow
some (base) protocol.  Obviously, both C++ (through pointers to base class and
polymorphism) and Smalltalk (because everything is ultimately an Object) have
analogues to this.  However, I think what is desired is something where
objects in the collection are not related and, therefore, follow no set
protocol.  For instance, in the following:

	tax_collection: COLLECTION [TAX]

users of the collection know that (at the very least) all objects obtained
from the collection will follow the TAX object protocol.  On the other hand:

	h_collection: COLLECTION [void]		/* or is it 'void*'? */

might be a *truly* heterogeneous collection (assuming objects entered into the
collection can be implicitly cast to VOID), but (going back to the original
question) how useful would it be since all clues as to type and protocol of
objects in the collection are removed?
--
====================================================================
David Masterson					Consilium, Inc.
(415) 691-6311					640 Clyde Ct.
uunet!cimshop!davidm				Mtn. View, CA  94043
====================================================================
"If someone thinks they know what I said, then I didn't say it!"
Technical Details
Message-ID: <CIMSHOP!DAVIDM.91Apr1224716@uunet.UU.NET>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!cimshop!davidm
References: <1991Mar25.220525.11087@leland.Stanford.EDU> <CIMSHOP!DAVIDM.91Mar28192651@uunet.UU.NET> <521@eiffel.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!cimshop!davidm
From: cimshop!davidm@uunet.UU.NET (David S. Masterson)
Newsgroups: comp.lang.misc,comp.object
Subject: Re: CHALLENGE: heterogeneous collections
Message-ID: <CIMSHOP!DAVIDM.91Apr1224716@uunet.UU.NET>
Date: 2 Apr 91 06:47:16 GMT
References: <1991Mar25.220525.11087@leland.Stanford.EDU>
 <CIMSHOP!DAVIDM.91Mar28192651@uunet.UU.NET> <521@eiffel.UUCP>
Sender: davidm@cimshop.UUCP
Distribution: comp
Organization: Consilium Inc., Mountain View, California
Lines: 55
In-reply-to: bertrand@eiffel.UUCP's message of 30 Mar 91 01:41:37 GMT