[Lazarus] object type: strange behaviour
Hans-Peter Diettrich
DrDiettrich1 at aol.com
Fri Oct 22 21:55:16 CEST 2010
Graeme Geldenhuys schrieb:
> I still don't get why Borland/Embarcadero did that... records with methods.
> MvC hinted that it is because .Net has records with methods. But delphi
> Objects do exactly that, and existed since Turbo Pascal days. In terms of
> Delphi, what exactly is the difference between a "record with methods" and
> a Object?
Delphi Objects should only be used with TP7 member types.
The initialization and finalization, required for managed types
(AnsiString...), is broken in derived Objects, since the introduction of
these types. Because it were easy to fix that bug (like with nested
records), it seems to be a purely political decision, to deprecate the
Object type for a real reason. Note that Object types with no ancestors
are properly initialized and finalized...
DoDi
More information about the Lazarus
mailing list