🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #3324

Re: CHALLENGE: heterogeneous collections

#3324
From: Joseph Pallas
Date: Mon, 01 Apr 1991 18:36
45 lines
2579 bytes
In <b32pvj.em4@wang.com> marcs@slc.com (Marc San Soucie) writes of my
definition of heterogeneous collections:

>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.

Now, I have to admit that, at first glance, it may seem odd that the
definition I offered has this dependency.  But I think I can explain
why it does.

We all seem to agree that "heterogeneous" has something to do with the
types of objects.  The problem arises from the very nature of OOP in
that it emphasizes inclusion polymorphism (usually in the form of
subtypes).  The consequence of this is that it is not possible in
general to speak of "the type" of some object.  Objects have many
types, as the types are organized hierarchically in a containment
relationship.

Now, we can (as Marc pointed out) simply stop there and say that in
Smalltalk, for example, there are no heterogeneous collections because
there is a type of which all objects are members.  But that clearly
doesn't capture the notion we have in mind when we talk about
heterogeneous collections.  So, given a collection of objects and a
desire to talk about the types of those objects, how do we decide
which types to use?  I claim that, in a dynamically typed language
like Smalltalk, the only types we can sensibly use for this kind of
discrimination are the types implied by the operations we actually
perform.

>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.

This isn't very interesting, since this definition makes all Smalltalk
collections heterogeneous.  It doesn't capture the common notion that
collections are either homogeneous or heterogeneous.

As for the question of whether this discussion is leading anywhere, I
suspect not.

joe
Technical Details
Message-ID: <pallas.670531008@red-dwarf>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!sun-barr!newstop!exodus!red-dwarf!pallas
References: <objtch.670026043@extro> <objtch.670045723@extro> <pallas.670095067@red-dwarf> <b32pvj.em4@wang.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!sun-barr!newstop!exodus!red-dwarf!pallas
From: pallas@eng.sun.com (Joseph Pallas)
Newsgroups: comp.lang.misc
Subject: Re: CHALLENGE: heterogeneous collections
Message-ID: <pallas.670531008@red-dwarf>
Date: 1 Apr 91 18:36:48 GMT
References: <objtch.670026043@extro> <objtch.670045723@extro> <pallas.670095067@red-dwarf> <b32pvj.em4@wang.com>
Sender: news@exodus.Eng.Sun.COM
Lines: 45