<p>Am 01.03.2017 10:06 schrieb "Graeme Geldenhuys" <<a href="mailto:mailinglists@geldenhuys.co.uk">mailinglists@geldenhuys.co.uk</a>>:<br>
><br>
> On 2017-03-01 02:39, <a href="mailto:noreply@z505.com">noreply@z505.com</a> wrote:<br>
> > How come:<br>
> ><br>
> > class operator Initialize(var aFoo: TFoo);<br>
> > class operator Finalize(var aFoo: TFoo);<br>
> ><br>
> > in a record are called class operator..<br>
> ><br>
> > why not "record operator"?<br>
><br>
><br>
> hahaha... You are asking all the questions I've been meaning to ask too.<br>
> From your question, just goes to show how rubbish Delphi is being<br>
> designed these days. Mixing concepts of class and record<br>
> interchangeably. And now we have "records" with constructors and<br>
> destructors! WTF. EMBT/Delphi are seriously polluting the Object Pascal<br>
> with all this rubbish. Unfortunately FPC feels like they need to follow<br>
> them like lemmings.</p>
<p>Records don't allow destructors, only constructors. Also they allow to more tightly couple initialization functions for some record with the record they belong to. Same for operators by the way: without them you couldn't use a record's operators in generics. Also I personally prefer to have routines that deal explicitly with a given records type as part of said record.</p>
<p>Regards,<br>
Sven</p>