Consider this test case:
---8<---
{$mode ObjFPC}
// EXPECTED: 'Error: Identifier not found "result"'
// ACTUAL BUG #1: gets compiled
operator - (const L, R: Char) returned: Char;
begin
result := 'Z'
end;
// EXPECTED: gets compiled
// ACTUAL BUG #2: 'Error: Duplicate identifier "r
Am 15.12.2020 um 20:00 schrieb bla...@blaise.ru:
Consider this test case:
---8<---
{$mode ObjFPC}
// EXPECTED: 'Error: Identifier not found "result"'
// ACTUAL BUG #1: gets compiled
operator - (const L, R: Char) returned: Char;
begin
result := 'Z'
end;
// EXPECTED: gets compiled
//
On 16.12.2020 0:07, Sven Barth wrote:
No, those two are in fact correct this way.
Is that the /team's/ consensus?
The modeswitch Result enables the use of Result as an alias for *any* routine …
Incorrect. The identifier Result does not alias the routine, it aliases the
routine's return val
On Wed, 16 Dec 2020, Blaise--- via fpc-devel wrote:
On 16.12.2020 0:07, Sven Barth wrote:
No, those two are in fact correct this way.
Is that the /team's/ consensus?
The modeswitch Result enables the use of Result as an alias for *any*
routine …
Incorrect. The identifier Result does not
Blaise--- via fpc-devel schrieb am Mi.,
16. Dez. 2020, 10:14:
> > The modeswitch Result enables the use of Result as an alias for *any*
> routine …
>
> Incorrect. The identifier Result does not alias the routine, it aliases
> the routine's return value.
>
For non operators the routine's name *is
On Wed, 16 Dec 2020 10:24:39 +0100 (CET)
Michael Van Canneyt via fpc-devel
wrote:
>[...]
> Function MyResult : String;
>
> begin
>Result:='';
>MyResult:='';
> end;
>
> You can still use the function name for the result, so "Result" is in
> fact an alias for the function name, which is t
On 16.12.2020 12:24, Michael Van Canneyt via fpc-devel wrote:
To be correct: Result is not the name of the result value, it is an alias.
I did not dispute that. The important point here is: "an alias" to /what/?
You can still use the function name for the result, so "Result" is in fact an
al
On Wed, 16 Dec 2020, Blaise--- via fpc-devel wrote:
On 16.12.2020 12:24, Michael Van Canneyt via fpc-devel wrote:
To be correct: Result is not the name of the result value, it is an alias.
But, conceptually, I would rather look at the function name resolving to the
return value as a backwa
On 2020-12-16 12:25, Blaise--- via fpc-devel wrote:
On 16.12.2020 12:24, Michael Van Canneyt via fpc-devel wrote:
To be correct: Result is not the name of the result value, it is an
alias.
I did not dispute that. The important point here is: "an alias" to
/what/?
You can still use the funct
Michael Van Canneyt via fpc-devel schrieb
am Mi., 16. Dez. 2020, 12:47:
> We can of course consider changing the current behaviour in the future, as
> far as I
> know there is no urgency in this ATM. There are other, more urgent tasks...
>
I agree. Please concentrate on anonymous functions and d
10 matches
Mail list logo