[fpc-devel] Re: Proposal: Enhanced replacement for assignment operators

Honza befelemepeseveze at gmail.com
Fri Aug 6 16:49:25 CEST 2010

On Fri, Aug 6, 2010 at 21:31, Alexander Klenin wrote:

> Sorry, but I do not believe you have ever tried.
> Here are samples, please try compiling them before asserting that they
> work fine:
> ---
> var a: Double;
> begin
>  Inc(a, 2.0);
> end.
> ---
> {$mode objfpc}
> type TPoint=record x, y: Integer; end;
> operator+(const a, b: TPoint): TPoint; begin { ... } end;
> var a, b: TPoint;
> begin
>  Inc(a, b);
> end.
> ---


Inc and friends (Succ, ...) are defined on ordinal types only and
actually they work just fine. The above examples are outside of that
definition domain. Additionally, semantics of Inc is defined using the
add operation, not using the add/plus operator, iirc.


More information about the fpc-devel mailing list