[fpc-pascal] with in classes/records
ryan at thealchemistguild.com
Tue Sep 4 08:48:56 CEST 2018
> On Sep 4, 2018, at 12:35 PM, Sven Barth via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> I think you need to be clearer what you want to achieve in the end. The
> default property as intended by Maciej has the idea that it hoists the
> operators of the default property type to the record it is contained in.
> E.g. if the type has a "+" defined then using "+" on the record will use
> it on the default field instead. From what I remember from one of your
> previous mails your idea seems to be more to make other records part of
> the record, basically like compositing. Here the question would be if
> the operators of the contained type are at all hoisted to the container
> type (especially if you have multiple ones and one of them defines a
> certain operator and the other doesn't, not to forget other fields of
> the container record).
> So this would need to be explained/explored/specified first.
Yeah I think what I should do is provide a clear usage case later but just develop it as a default property for now and see what comes from it. My suspicion is that the way it’s implemented it's going to provide a clear path for multiple paths of indirection which could be used for delegation and as an alternative to subclassing, but we’ll save that for later and with the provision it makes sense and can be made safe.
More information about the fpc-pascal