Spring4D 1.2.1 release is getting close!

Spring4D 1.2.1 release is getting close!

It does not only contain a lot of bugfixes and improvements but also some new features (and a few minor breaking changes, sorry! but don't be worried). More about those in detail soon or in the Releasenotes.txt

Please have a look at all those in the release/1.2.1 branch. This is basically beta testing for the upcoming release - let us know if there are any issues.

We have a new red-black tree implementation which is used by the new TSortedDictionary and TSortedSet. Using the tree internally they always keep the items in order as specified by the default or the passed comparer.

There are also the new TOrderedDictionary and TOrderedSet who remember the item insertion order (they internally are hash based just like the regular TDictionary and THashSet but additionally remember the key insertion order).

See this example code:

procedure PrintSet(const values: ISet);
var
i: Integer;
begin
for i in values do
Write(i, ' ');
Writeln;
end;


begin
PrintSet(TCollections.CreateSet([5, 4, 3, 2, 1]));
PrintSet(TCollections.CreateOrderedSet([5, 4, 3, 2, 1]));
PrintSet(TCollections.CreateSortedSet([5, 4, 3, 2, 1]));
end.

The order of the first is "random" (well, determined by the internal hash) but not really predictable.
The second will print 5 4 3 2 1 because it keeps the insertion order and the third will print 1 2 3 4 5 as it has the items sorted.

More about the Spring4D 1.2.1 release soon ;)

Comments

Post a Comment