[Lazarus] Passing properties as var paramatars (was: Delphi editor clone)

Marc Weustink marc at dommelstein.net
Sat Nov 7 11:41:30 CET 2009


Alexander Klenin wrote:
> For each property argument, the compiler should create temporary variable,
> set it by reading the property before the function call, and set
> property to the new value
> after the call.
> 
> Inc(MyObj.MyIntProperty);
> =>
> var
>   temp: Integer;
> begin
>   temp := MyObj.MyIntProperty;
>   Inc(temp);
>   MyObj.MyIntProperty := temp;
> end;

At that time I proposed this too and there was a valid reason not to 
generate such code.

Marc






More information about the Lazarus mailing list