[fpc-devel] Proposal: In-out-parameters

_-jane-_ at web.de _-jane-_ at web.de
Mon Aug 9 23:44:52 CEST 2010

Hello Vinzent!

You wrote 2010-08-09:

> You should at least have used the 1995 version.
> Ada83 is pretty outdated, even here[tm], considering that
> Ada2005 compilers are available for about five years now. :D
> <[http://www.adahome.com/rm95/rm9x-06-02.html]>

You're right. I was lazy. This was the first report I've found. Has something changed for the specs of copy-[in]-out-parameters?

>> These kinds of parameter transmission can be used for properties.

> Well, it would involve a function call to the getter upon entry
> and another one to the setter upon exit.
> So it would be much more than just a by-copy transfer
> (which usually is nothing more than just using a register holding
> the value instead of a pointer to the actual memory location).

...but only if the properties are implemented via functions.
Nevertheless it works whereas a simple reference parameter does not directly, and that's the point of the proposal.

Copy-in-out-parameters can be simulated via a temporary variable which is transferred by reference, like the example I've given for op:= for properties, i.e. tmp:=obj.read_prop; function_call(tmp); obj.write_prop:=tmp;.
Probably this simulation is too good and kills the proposal.
On the other hand real copy-in-out-parameters can sometimes be a tad faster than reference-parameters...

GRATIS für alle WEB.DE Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de

More information about the fpc-devel mailing list