[fpc-pascal] Feature announcement: Dynamic array extensions

Sven Barth pascaldragon at googlemail.com
Sun Jun 3 18:17:24 CEST 2018


Ryan Joseph <ryan at thealchemistguild.com> schrieb am So., 3. Juni 2018,
10:22:

>
>
> > On Jun 3, 2018, at 3:15 PM, Sven Barth via fpc-pascal <
> fpc-pascal at lists.freepascal.org> wrote:
> >
> > Because operator overloads are static methods not normal methods.
>
> I don’t understand. Why aren’t both those variants possible? They’re both
> static I believe. The first is mutating the left side value and the second
> is a clone (the most common operation for += )
>
> class operator + (var left: TIntArray; const right: T);
> class operator + (constref left: TIntArray; const value: T): TIntArray;
>

Let me make one thing perfectly clear: the C-operators (+=, -=, *=, /=) do
not exist as explicit operators in FPC. They are merely syntactic sugar for
the more expressive variants and converted to those as soon as possible.

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20180603/2a8e749d/attachment.html>


More information about the fpc-pascal mailing list