SequenceableCollection>>#upTo has been deprecated - for 13 years and counting...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
cbc
Reply | Threaded
Open this post in threaded view
|

SequenceableCollection>>#upTo has been deprecated - for 13 years and counting...

cbc
Hi.

On the latest just updated trunk image, I got this deprecation warning, and did some spelunking.
* It was added almost 13 years ago.
* It is the only implementation of #upTo: that is deprecated (admittedly, the others are all on various flavors of Streams)
* It's preferred new name is #copyUpTo:, which is only present in SequenceableColletcion, no where else.

I like to use common messages across all objects that I can. I have fallen into the habit of using #upTo: against collections for years now (and didn't notice this because many, many years back I added this to various sub-classes of SequenceableCollection - bad me).

Am I wrong and I should just stop pretending that there are similarities between streams and collections?
Or, should I remove the deprecation warning, and let it silently continue to do what I've been doing for years?  If so, I'll push this to the inbox so someone else can copy it to trunk.

My third option I'm going to ignore (copying the code from #copyUpTo: to #upTo:) because it is heavily used in the image - and when you know you have a collection, it is a more correct name.

Thanks,
-cbc

ps - do we have a limit on how long deprecations can stay in the system?


Reply | Threaded
Open this post in threaded view
|

Re: SequenceableCollection>>#upTo has been deprecated - for 13 years and counting...

Hannes Hirzel
Hello Chris,

On 4/13/17, Chris Cunningham <[hidden email]> wrote:
> Hi.
>
> On the latest just updated trunk image, I got this deprecation warning,


SequenceableCollection
upTo: anObject
        "Deprecated. Use copyUpTo:"
        self deprecated: 'Use #copyUpTo:'.
        ^ self copyUpTo: anObject



> and did some spelunking.
> * It was added almost 13 years ago.

Yes.

> * It is the only implementation of #upTo: that is deprecated (admittedly,
> the others are all on various flavors of Streams)


> * It's preferred new name is #copyUpTo:, which is only present in
> SequenceableColletcion, no where else.



> I like to use common messages across all objects that I can. I have fallen
> into the habit of using #upTo: against collections for years now (and
> didn't notice this because many, many years back I added this to various
> sub-classes of SequenceableCollection - bad me).
>
> Am I wrong and I should just stop pretending that there are similarities
> between streams and collections?

There are many implementations of upTo:

> Or, should I remove the deprecation warning, and let it silently continue
> to do what I've been doing for years?

Maybe the best option.

Pharo 5.0 has  #copyUpTo:  but no #upTo:
So they removed #upTo:

It would be good to find out why they did it.

> If so, I'll push this to the inbox
> so someone else can copy it to trunk.
>
> My third option I'm going to ignore (copying the code from #copyUpTo: to
> #upTo:) because it is heavily used in the image - and when you know you
> have a collection, it is a more correct name.


> Thanks,
> -cbc
>
> ps - do we have a limit on how long deprecations can stay in the system?

No limit as far as I know. But it would be good to have at least an
idea, e.g. 6 years.

--Hannes