[fpc-pascal] Class constructor called unconditionally
Sven Barth
pascaldragon at googlemail.com
Thu Mar 31 19:06:37 CEST 2016
Am 31.03.2016 17:28 schrieb "Graeme Geldenhuys" <
mailinglists at geldenhuys.co.uk>:
>
> On 2016-03-31 16:06, Michael Van Canneyt wrote:
>
> > I am guessing it comes from C++/Java/C#, which AFAIK do not have
> > the 'initialization' section. But that's just a guess.
>
> [my personal opinion - feel free to ignore this paragraph]
>
> I hate such "features" pulled in from other languages, when Object
> Pascal already had perfectly good solutions (Object vs Record with
> Methods is another example). It really feels like it is polluting the
> Object Pascal language.
Class constructors allow for a closer coupling between classes and their
initialization and as Maciej said: for generics there is not really another
way as the specializations are more or less everywhere (though with
generics that doesn't currently work correctly anyway, but that's on my
todo list).
(analogous for class destructors)
Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160331/1f364ec8/attachment.html>
More information about the fpc-pascal
mailing list