<div dir="ltr"><div>Hi,</div><div><br></div><div>I have found the old announcement about fpc-generics-collections, but all links are broken...</div><div><br></div><div>What is the status of this project?</div><div><br></div><div>Is it still downloadable?</div><div><br></div><div>Thank you,</div><div>Gennady</div><div><div itemtype="http://schema.org/Article" itemscope=""><div>
<div>
<h1>
<span><a href="https://www.mail-archive.com/search?l=fpc-devel@lists.freepascal.org&q=subject:%22%5Bfpc-devel%5D+Library+announcement%3A+Generics.Collections%22" rel="nofollow"><span itemprop="name"><font color="#000080">[fpc devel] Library announcement: Generics.Collections</font></span></a></span>
</h1>
<p>
<span><a href="https://www.mail-archive.com/search?l=fpc-devel@lists.freepascal.org&q=from:%22Maciej+Izak%22" rel="nofollow"><span itemtype="http://schema.org/Person" itemscope="" itemprop="author"><span itemprop="name"><font color="#000080">Maciej Izak</font></span></span></a></span>
<span><a href="https://www.mail-archive.com/search?l=fpc-devel@lists.freepascal.org&q=date:20130522" rel="nofollow"><span itemprop="datePublished" content="2013-05-22T12:45:20-0700"><font color="#000080">Wed, 22 May 2013 12:45:20 -0700</font></span></a></span>
</p>
</div>
<div itemprop="articleBody">
<pre>Hi Free Pascal community!
I'm pleased to announce the generic library, compatible with Delphi
Generics.Collections (almost ;) ).</pre><pre>Homepage
<a href="https://code.google.com/p/fpc-generics-collections/" rel="nofollow"><font color="#000080">https://code.google.com/p/fpc-generics-collections/</font></a>
SVN
<a href="http://fpc-generics-collections.googlecode.com/svn/trunk/" rel="nofollow"><font color="#000080">http://fpc-generics-collections.googlecode.com/svn/trunk/</font></a>
=== modules ===
Generics.Defaults
Generics.Collections
Generics.Helpers
Generics.Hashes
=== compatible classes ===
TEnumerator<T>
TEnumerable<T>
TList<T>
TQueue<T>
TStack<T>
TDictionary<TKey, TValue>
TObjectList<T: TObject>
TObjectStack<T: TObject>
TObjectDictionary<TKey, TValue>
=== renamed (because compiler limations/bug) ===
TArrayHelper<T> instead of TArray<T>
=== additional classes ===
************
TDictionary<TKey, TValue, TProbeSequence, THash, THashFactory>
TObjectDictionary<TKey, TValue, TProbeSequence, THash, THashFactory>
TKey - key, TValue - value, THashFactory - hash factory :)
TProbeSequence - TProbeSequence is special record for open addresing.
To choose from a predefined:
TLinearProbing, TQuadraticProbing, TDoubleHashing,
TFastLinearProbing, TFastQuadraticProbing, TFastDoubleHashing (fast
version is without "mod")
more info at <a href="http://en.wikipedia.org/wiki/Open_addressing" rel="nofollow"><font color="#000080">http://en.wikipedia.org/wiki/Open_addressing</font></a>
THash - type for hash (to reduce size of dictionary - can be UInt8,
UInt16, UInt32 etc.)
For example, Delphi TDictionary version in this library is defined as:
TDictionary<TKey, TValue> = class(TDictionary<TKey, TValue,
TFastLinearProbing, UInt32, TDelphiHashFactory>);
************
TDictionaryList<TKey, TValue, TIndex, THash, THashFactory>
class, that combines a TList and TDictionary
TKey - key, TValue - value, THashFactory - hash factory :)
TIndex - type for index (to reduce size of dictionary - can be UInt8,
UInt16, UInt32 etc.)
THash - type for hash (to reduce size of dictionary - can be UInt8,
UInt16, UInt32 etc.)
************
Similar to TList, TDictionary and TDictionaryList, but uses normal
operators instead of IEqualityComparer.
TFastList
TFastDictionary
TFastDictionaryList
************
TFastArrayHelper<T> - similar rules as above
=== not implemented ===
TThreadedQueue<T>
=== FAQ ===
1. How to use record as Key or Value in dictionary?
You need to wait for some compiler magic ( system functions
GetReferenceToValue and GetValueSize described bolow)
or add two methods to record:
TRecord = record
(* ... *)
function GetValueSize: Integer; inline;
function GetReferenceToValue: Pointer; inline;
end;
2. How to use Pointer or some custom type as Key or Value in dictionary?
You need to wait for some compiler magic ( system functions
GetReferenceToValue and GetValueSize described bolow)
or use TValueHelper:
uses
Generics.Collections, Generics.Helpers;
(* ... *)
type
TValueHelperPointer = TValueHelper<Pointer>;
var
d: TDictionary<TValueHelperPointer, string>;
begin
(* ... *)
d.Add(nil, 'foo');
=== TODO ===
Comparer from Generics.Defaults can be optimized.
I have no knowledge of FPC compiler design, so i need a little help...
First thing : To finish my work I need critical compiler magic
functions/feature. At first look mayby there is no sense for this functions
but during work on Generic library it's necessary:
function GetReferenceToValue(Value: T): Pointer; // for string types
return @s[1] or nil for empty string for Int32 return @i etc. returns a
reference to the value, as
measured by human/programmer
function GetValueSize(Value: T): Integer; // for string types return
Length(s), for Int32 returs 4 etc.
This functions should be implemented as operators (like Inc, Dec operators).
There is half-workaround/cripled solution as record/type helpers (module
Generics.Helpers). Don't work for custom strings, and for custom "basic"
types like:
type MyStr = type string;
type MyInt = type Int32;
Second thing: Bugs. Look at Critical - fix is needed to perform
compatibility with Delphi and proper work.
<a href="http://bugs.freepascal.org/view.php?id=24283" rel="nofollow"><font color="#000080">http://bugs.freepascal.org/view.php?id=24283</font></a> (CRITICAL! Very
Important!)
<a href="http://bugs.freepascal.org/view.php?id=24282" rel="nofollow"><font color="#000080">http://bugs.freepascal.org/view.php?id=24282</font></a> (CRITICAL! Very
Important!)
<a href="http://bugs.freepascal.org/view.php?id=24254" rel="nofollow"><font color="#000080">http://bugs.freepascal.org/view.php?id=24254</font></a> (CRITICAL! for
TArray.Sort<T>)
<a href="http://bugs.freepascal.org/view.php?id=24287" rel="nofollow"><font color="#000080">http://bugs.freepascal.org/view.php?id=24287</font></a> (Very Important!)
<a href="http://bugs.freepascal.org/view.php?id=24072" rel="nofollow"><font color="#000080">http://bugs.freepascal.org/view.php?id=24072</font></a> (Very Important!)
<a href="http://bugs.freepascal.org/view.php?id=24097" rel="nofollow"><font color="#000080">http://bugs.freepascal.org/view.php?id=24097</font></a> (Important!)
<a href="http://bugs.freepascal.org/view.php?id=24064" rel="nofollow"><font color="#000080">http://bugs.freepascal.org/view.php?id=24064</font></a> (Important!)
<a href="http://bugs.freepascal.org/view.php?id=24071" rel="nofollow"><font color="#000080">http://bugs.freepascal.org/view.php?id=24071</font></a> (Important!)
<a href="http://bugs.freepascal.org/view.php?id=24285" rel="nofollow"><font color="#000080">http://bugs.freepascal.org/view.php?id=24285</font></a> (Important!)
<a href="http://bugs.freepascal.org/view.php?id=24286" rel="nofollow"><font color="#000080">http://bugs.freepascal.org/view.php?id=24286</font></a> similar to 24285
<a href="http://bugs.freepascal.org/view.php?id=24458" rel="nofollow"><font color="#000080">http://bugs.freepascal.org/view.php?id=24458</font></a>
<a href="http://bugs.freepascal.org/view.php?id=24098" rel="nofollow"><font color="#000080">http://bugs.freepascal.org/view.php?id=24098</font></a> (Frustrating)
<a href="http://bugs.freepascal.org/view.php?id=24073" rel="nofollow"><font color="#000080">http://bugs.freepascal.org/view.php?id=24073</font></a>
<a href="http://bugs.freepascal.org/view.php?id=24463" rel="nofollow"><font color="#000080">http://bugs.freepascal.org/view.php?id=24463</font></a>
--
Regards,
HNB
</pre><pre>_______________________________________________
fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-devel" rel="nofollow"><font color="#000080">http://lists.freepascal.org/mailman/listinfo/fpc-devel</font></a>
</pre>
</div>
<div>
<ul>
<li><a accesskey="p" href="https://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg29241.html"><font color="#000080">Previous message</font></a></li>
<li><a accesskey="c" href="https://www.mail-archive.com/fpc-devel@lists.freepascal.org/thrd9.html#29246"><font color="#000080">View by thread</font></a></li>
<li><a accesskey="i" href="https://www.mail-archive.com/fpc-devel@lists.freepascal.org/mail9.html#29246"><font color="#000080">View by date</font></a></li>
<li><a accesskey="n" href="https://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg29253.html"><font color="#000080">Next message</font></a></li>
</ul>
</div>
<a name="tslice"></a>
<div>
<ul>
<li><span>[fpc-devel] Library announcement: Generics.Collections</span> <span>Maciej Izak</span></li>
<li><ul>
<li><span><a href="https://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg29253.html"><font color="#000080">[fpc-devel] Re: Library announcement: Generics.Col...</font></a></span> <span>Maciej Izak</span></li>
<li><span><a href="https://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg29255.html"><font color="#000080">Re: [fpc-devel] Library announcement: Generics.Col...</font></a></span> <span>Sven Barth</span></li>
<li><ul>
<li><span><a href="https://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg29258.html"><font color="#000080">Re: [fpc-devel] Library announcement: Generics...</font></a></span> <span>Maciej Izak</span></li>
<li><ul>
<li><span><a href="https://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg29259.html"><font color="#000080">Re: [fpc-devel] Library announcement: Gene...</font></a></span> <span>Sven Barth</span></li>
</ul></li>
<li><span><a href="https://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg29260.html"><font color="#000080">Re: [fpc-devel] Library announcement: Generics...</font></a></span> <span>Marco van de Voort</span></li>
<li><ul>
<li><span><a href="https://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg29261.html"><font color="#000080">Re: [fpc-devel] Library announcement: Gene...</font></a></span> <span>Sven Barth</span></li>
</ul>
</li></ul>
</li></ul>
</li></ul>
</div>
<div>
<div>
<h2>
Reply via email to
</h2>
<form action="/mailto.php" method="POST">
</form>
</div>
</div>
</div>
<div>
<div>
<a href="https://www.mail-archive.com/"><img width="247" height="88" alt="The Mail Archive" src="https://www.mail-archive.com/logo.png"></a>
</div>
<form action="/search" method="get">
<input name="q" id="q" type="text">
<input name="submit" type="image" alt="Submit" src="https://www.mail-archive.com/submit.png">
</form>
<div id="nav">
<ul>
<li><a href="https://www.mail-archive.com/"><font color="#000080">The Mail Archive home</font></a></li>
<li><a href="https://www.mail-archive.com/fpc-devel@lists.freepascal.org/"><font color="#000080">fpc-devel - all messages</font></a></li>
<li><a href="https://www.mail-archive.com/fpc-devel@lists.freepascal.org/info.html"><font color="#000080">fpc-devel - about the list</font></a></li>
<li><a href="https://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg29241.html"><font color="#000080">Previous message</font></a></li>
<li><a href="https://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg29253.html"><font color="#000080">Next message</font></a></li>
</ul>
</div>
<div>
</div>
<div>
</div>
</div>
</div>
<div>
<ul>
<li><a href="https://www.mail-archive.com/"></a></li></ul></div></div></div>