On 24/12/2021 18:07, Bart via fpc-devel wrote:
On Fri, Dec 24, 2021 at 12:00 PM Adriaan van Os via fpc-devel
wrote:
Neither would the compiler allow (I hope) the const parameter to be passed as a
var parameter.
It does not:
{$mode objfpc}
{$h+}
procedure foo(var x: integer);
begin
end;
pr
On Fri, Dec 24, 2021 at 12:00 PM Adriaan van Os via fpc-devel
wrote:
> Neither would the compiler allow (I hope) the const parameter to be passed as
> a var parameter.
It does not:
{$mode objfpc}
{$h+}
procedure foo(var x: integer);
begin
end;
procedure bar(const y: integer);
begin
foo(y);
Michael Van Canneyt via fpc-devel wrote:
I will probably have to rephrase the documentation to 'The compiler will
not allow you to modify the parameter value by assigning something
directly to it."
Neither would the compiler allow (I hope) the const parameter to be passed as a
var parameter.
On Mon, 20 Dec 2021, Bart via fpc-devel wrote:
On Mon, Dec 20, 2021 at 12:07 PM Martin Frb via fpc-devel
wrote:
https://www.freepascal.org/docs-html/current/ref/refsu67.html#x183-20700014.4.4
> Specifying a parameter as Constant is giving the compiler a hint that
the contents of the parame
On Mon, Dec 20, 2021 at 12:07 PM Martin Frb via fpc-devel
wrote:
> https://www.freepascal.org/docs-html/current/ref/refsu67.html#x183-20700014.4.4
> > Specifying a parameter as Constant is giving the compiler a hint that
> the contents of the parameter will not be changed by the called routine.
On Mon, 20 Dec 2021, Martin Frb via fpc-devel wrote:
On 20/12/2021 12:29, Michael Van Canneyt wrote:
On Mon, 20 Dec 2021, Martin Frb via fpc-devel wrote:
Actually an commission, but an important one.
https://www.freepascal.org/docs-html/current/ref/refsu67.html#x183-20700014.4.4
> Sp
On 20/12/2021 12:29, Michael Van Canneyt wrote:
On Mon, 20 Dec 2021, Martin Frb via fpc-devel wrote:
Actually an commission, but an important one.
https://www.freepascal.org/docs-html/current/ref/refsu67.html#x183-20700014.4.4
> Specifying a parameter as Constant is giving the compiler a h
On Mon, 20 Dec 2021, Martin Frb via fpc-devel wrote:
Actually an commission, but an important one.
https://www.freepascal.org/docs-html/current/ref/refsu67.html#x183-20700014.4.4
> Specifying a parameter as Constant is giving the compiler a hint that
the contents of the parameter will not be
Actually an commission, but an important one.
https://www.freepascal.org/docs-html/current/ref/refsu67.html#x183-20700014.4.4
> Specifying a parameter as Constant is giving the compiler a hint that
the contents of the parameter will not be changed by the called routine.
"by the called routine.