This page is no longer maintained — Please continue to the home page at www.scala-lang.org

collections work

2 replies
odersky
Joined: 2008-07-29,
User offline. Last seen 45 weeks 6 days ago.
I checked in some larger changes to the collection libraries. In particular:

- Split IndexedSeqLike into IndexedSeqLike and IndexedSeqOptimized as discussed in my earlier rmail.

- Did the same for LinearSeqLike.

- Removed IndexedSeqView - it added nothing to SeqView except a dubious optimization. As an added benefit this uncovered a well hidden landmine in RichChar, where the until and to methods still produced an IndexedSeqView, i.e. a lazy structure, even though the other ranges are now strict. That would have been a beauty to chase down!  (mutable.IndexedSeqView is still there, of course).

- Made `until` and `to` methods in RichChar return a NumericRange[Char].

- Added an implicit Numeric[Char] to Numeric. This is logical because Char's are numbers and it's also necessary to make the previous change work.

- Removed TreeHashMap, which was still awaiting ``reintergration''. This is now superseded by HashTries I think,

- Renamed GenericArray to ArraySeq. GenericArray was a bit too generic as a term.

What remains to be done now: Work on Vector to integrate it better in the libraries (in particular, make it the default impl for immutable IndexedSeq's, as we do not have any other good candidate for that). Also, fix the reported bug on Vector.filter. Tiark, do you want to do this, or do you want someone to take this over?

Cheers

 -- Martin



Tiark Rompf
Joined: 2009-02-18,
User offline. Last seen 42 years 45 weeks ago.
Re: collections work

On Apr 5, 2010, at 3:48 PM, martin odersky wrote:

> I checked in some larger changes to the collection libraries. In particular:
>
> - Split IndexedSeqLike into IndexedSeqLike and IndexedSeqOptimized as discussed in my earlier rmail.
>
> - Did the same for LinearSeqLike.
>
> - Removed IndexedSeqView - it added nothing to SeqView except a dubious optimization. As an added benefit this uncovered a well hidden landmine in RichChar, where the until and to methods still produced an IndexedSeqView, i.e. a lazy structure, even though the other ranges are now strict. That would have been a beauty to chase down! (mutable.IndexedSeqView is still there, of course).
>
> - Made `until` and `to` methods in RichChar return a NumericRange[Char].
>
> - Added an implicit Numeric[Char] to Numeric. This is logical because Char's are numbers and it's also necessary to make the previous change work.
>
> - Removed TreeHashMap, which was still awaiting ``reintergration''. This is now superseded by HashTries I think,
>
> - Renamed GenericArray to ArraySeq. GenericArray was a bit too generic as a term.
>
> What remains to be done now: Work on Vector to integrate it better in the libraries (in particular, make it the default impl for immutable IndexedSeq's, as we do not have any other good candidate for that). Also, fix the reported bug on Vector.filter. Tiark, do you want to do this, or do you want someone to take this over?

I wouldn't mind somebody else doing it. The filter issue is already fixed and the other changes are probably pretty small. It would require some before/after performance sanity checks though.

- Tiark

odersky
Joined: 2008-07-29,
User offline. Last seen 45 weeks 6 days ago.
Re: collections work


On Mon, Apr 5, 2010 at 5:06 PM, Tiark Rompf <tiark.rompf@epfl.ch> wrote:

On Apr 5, 2010, at 3:48 PM, martin odersky wrote:

> I checked in some larger changes to the collection libraries. In particular:
>
> - Split IndexedSeqLike into IndexedSeqLike and IndexedSeqOptimized as discussed in my earlier rmail.
>
> - Did the same for LinearSeqLike.
>
> - Removed IndexedSeqView - it added nothing to SeqView except a dubious optimization. As an added benefit this uncovered a well hidden landmine in RichChar, where the until and to methods still produced an IndexedSeqView, i.e. a lazy structure, even though the other ranges are now strict. That would have been a beauty to chase down!  (mutable.IndexedSeqView is still there, of course).
>
> - Made `until` and `to` methods in RichChar return a NumericRange[Char].
>
> - Added an implicit Numeric[Char] to Numeric. This is logical because Char's are numbers and it's also necessary to make the previous change work.
>
> - Removed TreeHashMap, which was still awaiting ``reintergration''. This is now superseded by HashTries I think,
>
> - Renamed GenericArray to ArraySeq. GenericArray was a bit too generic as a term.
>
> What remains to be done now: Work on Vector to integrate it better in the libraries (in particular, make it the default impl for immutable IndexedSeq's, as we do not have any other good candidate for that). Also, fix the reported bug on Vector.filter. Tiark, do you want to do this, or do you want someone to take this over?

I wouldn't mind somebody else doing it. The filter issue is already fixed and the other changes are probably pretty small. It would require some before/after performance sanity checks though.

OK, I did the changes. Everything builds fine. I don't think there will be performance degradations, but it would be good if someone could verify this.

Cheers

 -- Martin

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland