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

Alexander Klenin klenin at gmail.com
Sat Nov 7 15:28:20 CET 2009


On Sat, Nov 7, 2009 at 23:24, Hans-Peter Diettrich <DrDiettrich1 at aol.com> wrote:
> Alexander Klenin schrieb:
>> Using temporary variables, there will be one call to each.
>
> Where would you place such temporary variables, in your sample code? Into an
> invisible layer between the caller and MyInc2?

Eh... on the stack, as usual. I am not sure what do you mean by
"invisible layer".

>
> [1] A quick comparison with Delphi 7 revealed:
>
> Delphi notices that a property cannot be passed as a var parameter.
>
> Delphi also denies Inc(obj.P), so that I have to adjust my opinion about the
> cleverness of Inc() :-(
> [What does not influence my opinion about the *expected* behaviour of Inc()
> :-]

Yes, passing property as var parameter. if implemented, would be a
FPC-only extension.

-- 
Alexander S. Klenin




More information about the Lazarus mailing list