[fpc-devel] Object upgrades

Sven Barth pascaldragon at googlemail.com
Mon Jun 10 22:04:01 CEST 2019


Ryan Joseph <genericptr at gmail.com> schrieb am Mo., 10. Juni 2019, 20:31:

>
>
> > On Jun 10, 2019, at 2:26 PM, Sven Barth via fpc-devel <
> fpc-devel at lists.freepascal.org> wrote:
> >
> > Also FPC doesn’t have something “self” but for the class level so you
> need to cast the return value. Btw adding “ClassSelf” is something I’ve
> wanted for a while, so I can reference the class type within the class
> declaration.
> >
> > What are you talking about here?
> >
>
> Like this. I would prefer there being a “ClassSelf” type or something
> which acted as TSelf.
>
> type
>         TRecord = record
>                 public type
>                         TSelf = TRecord;
>                 public
>                         class operator + (left: TSelf; right: integer):
> TSelf;
>                         class operator + (left: TSelf; right: integer):
> TSelf;
>                         class operator - (left: TSelf; right: integer):
> TSelf;
>                         class operator * (left: TSelf; right: integer):
> TSelf;
>                         class operator / (left: TSelf; right: integer):
> TSelf;
>                         class operator ** (left: TSelf; right: integer):
> TSelf;
>                         class operator div (left: TSelf; right: integer):
> TSelf;
>                         class operator mod (left: TSelf; right: integer):
> TSelf;
>

Ehm... You are aware that you can simply use TRecord here?

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190610/da906ed8/attachment.html>


More information about the fpc-devel mailing list