Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!gatech2!swrinde!howland.reston.ans.net!torn!nott!cunews!dbuck
From: dbuck@superior.carleton.ca (Dave Buck)
Subject: Re: [VW} Set concatenation
X-Nntp-Posting-Host: superior.carleton.ca
Message-ID: <DIvGoC.K8x@cunews.carleton.ca>
Sender: news@cunews.carleton.ca (News Administrator)
Organization: Carleton University, Ottawa, Canada
References: <n1394554436.90705@smtpgwprod.ny.jpmorgan.com> <49hu7u$g0b@watnews2.watson.ibm.com> <95Nov29.121630est.205321@twist.db.toronto.edu> <49iokq$18lt@watnews2.watson.ibm.com>
Date: Thu, 30 Nov 1995 19:55:24 GMT
Lines: 64

In article <49iokq$18lt@watnews2.watson.ibm.com>,
David N. Smith  <dnsmith@watson.ibm.com> wrote:
>Uh, what SHOULD it mean for Interval?
>
>   (1 to: 10), (11 to: 20)
>      Should it be:
>         (1 to: 20)
>         Array(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20)

I agree with this.

>   (1 to: 10 by: 2), (2 to: 10 by: 2)
>      Should it be:
>         (1 to: 10)
>         Array(1 2 3 4 5 6 7 8 9 10)

It should be Array (1 3 5 7 9 2 4 6 8 10)

>      
>   (1 to: 10), (1 to: 10)
>      Should it be:
>         (1 to: 10)
>         Array(1 2 3 4 5 6 7 8 9 10)
>         Array(1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10)
>         Array(1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10)

I would favor:
   Array (1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10)

>I guess I would tend to favor this definition: 
>
>   , aCollection
>      self asArray, aCollection asArray

This makes sense.  It would be nice if we could avoid using asArray
and have some technique that uses species instead, but I can't think
of a nice way to do that off the bat.

>It is simple and answers the values in the order written. Thus, 
>
>   (1 to: 3), (7 to: 9)

>Now, what about Dictionary???  What do you do with duplicate keys that
>have different values? (And what does different mean?) 

You can't use , on Dictionaries because they are not indexable
collections.  The , operator normally means "all the elements of the
first collection followed by all the elements of the second."  Of
there is no ordering, the "followed by" doesn't make any sense.  This
definition works for me.

>
>Maybe it's Best Not to Mess With Mother Nature?   :-)

Aw, but this is Smalltalk.  We can mess with whatever we want. :-).

David Buck
dbuck@ccs.carleton.ca

_________________________________
| David K. Buck                 |
| dbuck@ccs.carleton.ca         |
| The Object People             |
|_______________________________|
