Re: [fpc-devel] Explicitly named return values and implicit aliases Result

2020-12-16 Thread Sven Barth via fpc-devel
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

Re: [fpc-devel] Explicitly named return values and implicit aliases Result

2020-12-16 Thread Tomas Hajny via fpc-devel
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

Re: [fpc-devel] Explicitly named return values and implicit aliases Result

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

Re: [fpc-devel] Explicitly named return values and implicit aliases Result

2020-12-16 Thread Blaise--- via fpc-devel
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

Re: [fpc-devel] Explicitly named return values and implicit aliases Result

2020-12-16 Thread Mattias Gaertner via fpc-devel
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

Re: [fpc-devel] Explicitly named return values and implicit aliases Result

2020-12-16 Thread Sven Barth via fpc-devel
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

Re: [fpc-devel] Explicitly named return values and implicit aliases Result

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

Re: [fpc-devel] Explicitly named return values and implicit aliases Result

2020-12-16 Thread Blaise--- via fpc-devel
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

Re: [fpc-devel] Explicitly named return values and implicit aliases Result

2020-12-15 Thread Sven Barth via fpc-devel
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 //