[fpc-devel] Pass compiler options to generics [was Delphi anonymous methods]

ListMember listmember at letterboxes.org
Wed Mar 6 21:51:58 CET 2013


On 2013-03-06 13:13, Alexander Klenin wrote:
> On Wed, Mar 6, 2013 at 10:00 PM, Michael Schnell <mschnell at lumino.de> wrote:
>> On 03/05/2013 05:17 PM, Alexander Klenin wrote:
>>> 1) Make sure "is" and "as" work with generic types -- maybe they already
>>> are?
>> "is" the generic type and/or "is" a certain specialization ?
> Yes, and also generic parameters.
>
> procedure TGenegic<T>Proc;
> begin
>    if T is String then ...
> end;

And, from then on, we're going to have to typecast each and every 
occurence of T..

Even if this was possible for every type of T, I wonder how doing that 
affects the performance of generics.

That's why I like the idea of passing compiler directives to generics to 
help eliminate parts of code (from the generic implementation) during 
compile-time.





More information about the fpc-devel mailing list