Last week I have finally got some free time on my hands to do something I was planning for a long time now: create a new package that will only provide a number of collections. What this means is that I took DeHL and stripped out everything that was not collection related; remodeled the classes to rely on Generics.Collections and Generics.Defaults standard units; and finished all the documentation.
What remained is a pure collection orientated package called (very unimaginatively) Collections. If you ever used DeHL’s collections you will most certainly recognize the code. But, while stripping out the bloat I was forced to re move some things that relied on that bloat:
- No more reliance on IType/TType. Collections now use IComparer and IEqualityComparer provided by Generics.Defaults.
- All associative collections use TPair now.
- Because IType was designed to provide cleanup for the enclosed values in the collections some reworking was necessary to make collections more Delphi-like. You still get the OwnsObjects, OwnsKeys and OwnsValues properties on the object variants.
- No more Op.Cast<> support. This Enex operation relied on TConverter which relied on IType and so on and so forth. Instead use a Op.Select with a casting predicate.
- Using NativeInt instead of NativeUInt in some places. This was a menace for a lot of people.
Note that Collections is not base-class or interface compatible with Generics.Collections. I could not make the proper compatibility because of interface support.
So what would you expect in the package:
- Full inline documentation. All APIs are properly documented. If you find any typos or errors please fill a bug!
- Test cases for mostly everything provided.
- A wide range of collections (much more than just stack, queue, list and dictionary).
- Enumerable extensions.
- Easy extensibility.
- Based on NativeInt instead of Integer. Ready at interface level for 64bit support.
Warning: This is a 1.0 release. There may still be some problems. If you find any please fill in a bug report. If you feel that you can help and implement something that is not included in the package feel free to contact me!