On Sun, Nov 08, 2009 at 12:17:35AM +, Howard Page-Clark wrote:
On Sat, 7 Nov 2009, Marco van de Voort wrote:
This is not orthogonal. VAR parameters are generally updated
instantaniously. By delaying the update over a temp variable you break
another aspect of the VAR parameter.
I
On Sat, 7 Nov 2009 13:44:39 +1000
Alexander Klenin kle...@gmail.com wrote:
[...]
2) However, there is an obvious room for improvement here:
not only Inc/Dec, but any procedure accepting var parameter
should be able to accept writeable property of the same type.
Var parameters must fit exactly
2009/11/7 Marc Weustink m...@dommelstein.net:
At that time I proposed this too and there was a valid reason not to
generate such code.
And that valid reason would be? I agree with Alexander and Mattias,
why can't the compiler generate such code behind the scenes?
--
Regards,
- Graeme -
Graeme Geldenhuys schreef:
2009/11/7 Marc Weustink m...@dommelstein.net:
At that time I proposed this too and there was a valid reason not to
generate such code.
And that valid reason would be? I agree with Alexander and Mattias,
why can't the compiler generate such code behind the scenes?
Graeme Geldenhuys schrieb:
At that time I proposed this too and there was a valid reason not to
generate such code.
And that valid reason would be? I agree with Alexander and Mattias,
why can't the compiler generate such code behind the scenes?
IMO such code (with temporary variables) is
Alexander Klenin schrieb:
The answer was that properties are meant to change the value on the object
immediately. Also a property setter can raise an exception, or additional
actions can take place or the value can be substituted
All this wouldn't happen with a temp variable (or at best
Martin schrieb:
Inc(MyObj.MyIntProperty);
=
var
temp: Integer;
begin
temp := MyObj.MyIntProperty;
Inc(temp);
MyObj.MyIntProperty := temp;
end;
Of course, if the compiler determines that the property is an alias
for a field,
it is free to pass the field directly -- but this is only an
Alexander Klenin wrote:
On Sat, Nov 7, 2009 at 14:15, Martin laza...@mfriebe.de wrote:
The answer was that properties are meant to change the value on the object
immediately. Also a property setter can raise an exception, or additional
actions can take place or the value can be
On Sat, Nov 7, 2009 at 23:24, Hans-Peter Diettrich drdiettri...@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?
On Sat, 7 Nov 2009, Marco van de Voort wrote:
On Sat, Nov 07, 2009 at 01:44:39PM +1000, Alexander Klenin wrote:
1) The change was correct in the sense that all properies should be treated
begin
temp := MyObj.MyIntProperty;
Inc(temp);
MyObj.MyIntProperty := temp;
end;
Of course, if the
On Sun, Nov 8, 2009 at 03:07, Michael Van Canneyt
mich...@freepascal.org wrote:
On Sat, 7 Nov 2009, Marco van de Voort wrote:
This is not orthogonal. VAR parameters are generally updated
instantaniously. By delaying the update over a temp variable you break
another aspect of the VAR parameter.
11 matches
Mail list logo