🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #3292

Re: CHALLENGE: heterogeneous collections

#3292
From: Marc San Soucie
Date: Fri, 29 Mar 1991 21:54
47 lines
2352 bytes
Joseph Pallas writes:

> In <objtch.670045723@extro> objtch@extro.ucc.su.oz.au (Peter Goodall)
> writes about a collection of Objects in Smalltalk.  But a collection
> of Objects is not a heterogeneous collection.  This may be a little
> confusing because Object is a universal supertype in Smalltalk.
>
> Let's be concrete:
>
> A heterogeneous collection is one for which no single type can be
> safely assigned to all members of the collection.
>
> If all of the members of the collection have some common supertype,
> AND no operation is performed on any member of the collection that is
> not valid for that common supertype, then the collection is a
> homogeneous collection of members of that supertype.
>
> So if you have a collection of objects, you have to do something to
> those objects that you can't safely do to Objects in order to have a
> heterogeneous collection.

This is pretty left-field thinking. A collection is an entity, not an activity.
The collection exists regardless of what you do or whether you do anything with
it. So argue the definition of the entity, not the operations that are to be
performed on it or its members.

Yes, in Smalltalk there is a base class from which everything inherits, so yes,
you can claim that in Smalltalk there cannot ever be a truly heterogeneous
collection. So in C++ every object is a bunch of bytes. Big deal.

How about a more accurate but possibly meaningless definition of a
heterogeneous collection:

    A collection on the types of whose members there are no explicit
    constraints.

From which derives the possibly equally meaningless theorem:

    It is easier to construct such a collection in a Smalltalk-like language
    than in a C++-like language.

Which leads me to wonder: Can this discussion lead to any meaningful insights?

    Marc San Soucie
    Servio Corporation
    Beaverton, Oregon
    marcs@slc.com
Technical Details
Message-ID: <b32pvj.em4@wang.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!bu.edu!wang!news
References: <objtch.670026043@extro> <objtch.670045723@extro> <pallas.670095067@red-dwarf>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!bu.edu!wang!news
From: marcs@slc.com (Marc San Soucie)
Newsgroups: comp.lang.misc
Subject: Re: CHALLENGE: heterogeneous collections
Message-ID: <b32pvj.em4@wang.com>
Date: 29 Mar 91 21:54:34 GMT
References: <objtch.670026043@extro> <objtch.670045723@extro> <pallas.670095067@red-dwarf>
Sender: news@wang.com
Organization: Servio Corporation
Lines: 47