[fpc-pascal] with in classes/records

Ryan Joseph ryan at thealchemistguild.com
Mon Sep 3 16:47:00 CEST 2018

> On Sep 3, 2018, at 9:17 PM, Martin <fpc at mfriebe.de> wrote:
> No it is not the same.
> You.f.Free;
> will always work, it is not ambiguous.
> You.Free;
> depends on no method Free being declared on the class of You, or any of its base classes, or any other default class (if more than one is allowed) that would be searched at higher priority.
> You.Free;
> has a risk, of suddenly and expectingly doing something else. Therefore it is not the same.
> It does however take the same action, if and only if there is no other Free, but the one you wanted.

I mean given that exact configuration calling Free arrives at the same location so it’s “the same”. The reason we made the default property was to *omit* the name of the property AND the name of the field it references. 

	Ryan Joseph

More information about the fpc-pascal mailing list