Re: [fpc-pascal] [fpc-devel] Nested function closures

2021-04-28 Thread Ryan Joseph via fpc-pascal
> On Apr 27, 2021, at 11:36 PM, Sven Barth wrote: > > Anyway, it would in principle be possible to convert an anonymous function to > a "is nested" function, but that will only come *after* the whole > implementation is here so that the chance for messing that core functionality > (!) up is

Re: [fpc-pascal] [fpc-devel] Nested function closures

2021-04-28 Thread Graeme Geldenhuys via fpc-pascal
Hello Sven, On 28/04/2021 6:32 am, Sven Barth via fpc-pascal wrote: > Second: the syntax is required for Delphi compatibility anyway Couldn't such verbose syntax be limited to {$mode delphi} behaviour, and then leave {$mode objfpc} free to experiment and introduce new less verbose syntax in the

Re: [fpc-pascal] [fpc-devel] Nested function closures

2021-04-28 Thread Martin Frb via fpc-pascal
On 28/04/2021 18:43, Graeme Geldenhuys via fpc-pascal wrote: Hello Sven, On 28/04/2021 6:32 am, Sven Barth via fpc-pascal wrote: Second: the syntax is required for Delphi compatibility anyway Couldn't such verbose syntax be limited to {$mode delphi} behaviour, and then leave {$mode objfpc} fre

Re: [fpc-pascal] [fpc-devel] Nested function closures

2021-04-28 Thread Ryan Joseph via fpc-pascal
> On Apr 28, 2021, at 10:43 AM, Graeme Geldenhuys via fpc-pascal > wrote: > > Couldn't such verbose syntax be limited to {$mode delphi} behaviour, > and then leave {$mode objfpc} free to experiment and introduce new > less verbose syntax in the language. Sven is having none of this and for go

Re: [fpc-pascal] [fpc-devel] Nested function closures

2021-04-28 Thread Graeme Geldenhuys via fpc-pascal
On 28/04/2021 6:26 pm, Martin Frb via fpc-pascal wrote: > Would omitting the type info not lead to issues with overloaded functions? Luckily others have already solved that problem. :-) Here is Java's JSR-355 and overloading is covered in Section F. https://jcp.org/aboutJava/communityprocess/f

[fpc-pascal] Detecting IO errors with INI file

2021-04-28 Thread James Richters via fpc-pascal
I'm trying to detect if an INI file is open by another program, but the way I normally do this is not working. // open the file for write and keep it open to test Assign(myfile,'my.ini'); Rewrite(myfile); {$i-} Assign(myfile2, 'my.ini'; Rewrite(myfile2);//try to open it for write again Wr

Re: [fpc-pascal] Detecting IO errors with INI file

2021-04-28 Thread Sven Barth via fpc-pascal
James Richters via fpc-pascal schrieb am Do., 29. Apr. 2021, 03:13: > {$i-} > > Log_Ini := TIniFile.Create(‘my.ini’); // blows up with 217 > > Writeln(ioresult); > > {$i+} > > > > The error I get is: > > An unhandled exception occurred at $005A57D0: > > EFOpenError: Unable to open file "LOG.INI

Re: [fpc-pascal] [fpc-devel] Nested function closures

2021-04-28 Thread Sven Barth via fpc-pascal
Graeme Geldenhuys via fpc-pascal schrieb am Mi., 28. Apr. 2021, 19:00: > Hello Sven, > > On 28/04/2021 6:32 am, Sven Barth via fpc-pascal wrote: > > Second: the syntax is required for Delphi compatibility anyway > > Couldn't such verbose syntax be limited to {$mode delphi} behaviour, > and then l

Re: [fpc-pascal] [fpc-devel] Nested function closures

2021-04-28 Thread Sven Barth via fpc-pascal
Martin Frb via fpc-pascal schrieb am Mi., 28. Apr. 2021, 19:26: > On 28/04/2021 18:43, Graeme Geldenhuys via fpc-pascal wrote: > > Hello Sven, > > > > On 28/04/2021 6:32 am, Sven Barth via fpc-pascal wrote: > >> Second: the syntax is required for Delphi compatibility anyway > > Couldn't such verb

Re: [fpc-pascal] [fpc-devel] Nested function closures

2021-04-28 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Mi., 28. Apr. 2021, 17:53: > > > > On Apr 27, 2021, at 11:36 PM, Sven Barth > wrote: > > > > Anyway, it would in principle be possible to convert an anonymous > function to a "is nested" function, but that will only come *after* the > whole implementation is

[fpc-pascal] non-virtual class methods called from virtual regular method

2021-04-28 Thread LacaK via fpc-pascal
Hi *, consider the following example T1 = class   class procedure CP1;   procedure P1; virtual; end; T2 = class(T1)   class procedure CP1; end; procedure T1.P1; begin   CP1; // here is called allways T1.CP1, right?   // if I want call T2.CP1 then class procedure CP1 must be also virtual, righ