[fpc-pascal] Generic type parameter variable initialization

Sven Barth pascaldragon at googlemail.com
Thu Jan 5 17:51:44 CET 2012


Am 05.01.2012 17:14, schrieb kyan:
>> Saying a FPC compiler developer to look at the Delphi implementation is
>> problematic, because than we could get accused of copying code (which is why
>> I use the Delphi XE starter version which does not contain the source code
>> of the RTL and VCL).
>
> I am sorry, I wasn't aware of that. But by means of testing I found
> that Finalize() works correctly for Variants in Lazarus as well. I
> don't know about the internals much but I suppose the place to look in
> FPC is procedure fpc_finalize() in objpas.inc which does handle
> tkVariant as well.

Hmm... the implementation of Default might not be that hard in the 
end... if I find the time I might experiment with an implementation at 
the weekend.

>> While this does indeed look nicely it's still not Delphi compatible ;)
>
> I think it is, it works in my Delphi XE exactly the way it does in
> Lazarus. It is just not defined in Delphi's RTL. I meant it as a temp
> solution until you implement Default() or something equivalent.

My sentence was meant like this: It looks nice and works in FPC and 
Delphi, but it can not be used the same as Default. ;)

Regards,
Sven



More information about the fpc-pascal mailing list