Re: [fpc-devel] Minor doc error about "const param"

2021-12-24 Thread Martin Frb via fpc-devel
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

Re: [fpc-devel] Minor doc error about "const param"

2021-12-24 Thread Bart via fpc-devel
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);

Re: [fpc-devel] Minor doc error about "const param"

2021-12-24 Thread Adriaan van Os via fpc-devel
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.

Re: [fpc-devel] Minor doc error about "const param"

2021-12-20 Thread Michael Van Canneyt via fpc-devel
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

Re: [fpc-devel] Minor doc error about "const param"

2021-12-20 Thread Bart via fpc-devel
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.

Re: [fpc-devel] Minor doc error about "const param"

2021-12-20 Thread Michael Van Canneyt via fpc-devel
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

Re: [fpc-devel] Minor doc error about "const param"

2021-12-20 Thread Martin Frb via fpc-devel
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

Re: [fpc-devel] Minor doc error about "const param"

2021-12-20 Thread Michael Van Canneyt via fpc-devel
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

[fpc-devel] Minor doc error about "const param"

2021-12-20 Thread Martin Frb via fpc-devel
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.