[fpc-pascal] readonly variables

Frank Peelo f26p at eircom.net
Sun Nov 29 22:31:56 CET 2009


Anthony Walter wrote:
> Okay, I am going to call bullshit on you. This is the second time (in
> a few weeks) where you've replied to something I've written with wrong
> information.
> 
> This first time concerning  the topic "const records passed
> incorrectly" you said, "It is nowhere written in the Delphi specs that
> const parameters are passed by reference. It is often so, but is by no
> means guaranteed"
> 
> That time I corrected you by pointing out the line in the help file
> contradicting your assertion.

Do you mean this one?

"Using const allows the compiler to optimize code for structured- and
string-type parameters."

"Allows" is not the same as "forces". This line in the help file does 
not say that const parameters are passed by reference. It says that it 
may often be so, perhaps all current implementations make it so, but it 
is by no means guaranteed.

Frank




More information about the fpc-pascal mailing list