Re: [fpc-pascal] Named optional arguments

2021-11-30 Thread Sven Barth via fpc-pascal
Am 28.11.2021 um 14:21 schrieb Ryan Joseph via fpc-pascal: On Nov 28, 2021, at 7:01 PM, Sven Barth wrote: Anything that relates to picking functions *must* be part of the overload handling. You can easily see this with your named argument proposal when not all arguments are named

Re: [fpc-pascal] Named optional arguments

2021-11-30 Thread Sven Barth via fpc-pascal
Am 28.11.2021 um 12:52 schrieb Ryan Joseph via fpc-pascal: On Nov 28, 2021, at 4:18 PM, Mattias Gaertner via fpc-pascal wrote: What do you mean? Is there already some call by arg names in some mode(switch)? I mean all the plumbing is there so the feature could easily be extended from

Re: [fpc-pascal] Named optional arguments

2021-11-28 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am So., 28. Nov. 2021, 03:12: > > > > On Nov 27, 2021, at 5:00 PM, Sven Barth > wrote: > > > > The compiler does not know which routine is called upon parsing the > parameter declarations (which would mean that error reports wou

Re: [fpc-pascal] Named optional arguments

2021-11-28 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am So., 28. Nov. 2021, 05:32: > > > > On Nov 27, 2021, at 5:03 PM, Sven Barth > wrote: > > > > candidates:=tcallcandidates.create(sym:=symtableprocentry, > st:=symtableproc,ppn:=left, > ignorevisibility:=ignorevisibility,all

Re: [fpc-pascal] Named optional arguments

2021-11-27 Thread Sven Barth via fpc-pascal
Am 27.11.2021 um 03:32 schrieb Ryan Joseph via fpc-pascal: On Nov 26, 2021, at 4:20 PM, Ryan Joseph wrote: It's mainly useful when reading code so you don't need to review the function definition, using code tools or any other method. I've been enjoying it in other languages when it's not

Re: [fpc-pascal] Named optional arguments

2021-11-27 Thread Sven Barth via fpc-pascal
Am 26.11.2021 um 05:10 schrieb Ryan Joseph via fpc-pascal: This was discussed before some years ago with no conclusion (https://www.mail-archive.com/fpc-pascal@lists.freepascal.org/msg46280.html) but I'd like to bring it up again. Can we consider extending the variant dispatch call named

Re: [fpc-pascal] Inline function parameters

2021-11-10 Thread Sven Barth via fpc-pascal
Am 11.11.2021 um 02:52 schrieb Ryan Joseph via fpc-pascal: On Nov 9, 2021, at 1:09 PM, Sven Barth via fpc-pascal wrote: No, because the function that is called with a function pointer needs to be inlined itself (thus becoming part of its caller) so that constant propagation works at all

Re: [fpc-pascal] Inline function parameters

2021-11-08 Thread Sven Barth via fpc-pascal
Am 09.11.2021 um 02:45 schrieb Ryan Joseph via fpc-pascal: On Nov 8, 2021, at 11:20 PM, Sven Barth via fpc-pascal wrote: I don't know what you mean with "new function body". If a function is inlined its code is contained within the surrounding function and if it's not inlined the

Re: [fpc-pascal] Inline function parameters

2021-11-08 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Mo., 8. Nov. 2021, 15:31: > > > > On Nov 8, 2021, at 1:27 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > And there you have it (simplified obviously). As long as the compiler > can

Re: [fpc-pascal] Inline function parameters

2021-11-07 Thread Sven Barth via fpc-pascal
Am 08.11.2021 um 03:45 schrieb Ryan Joseph via fpc-pascal: On Nov 7, 2021, at 2:17 PM, Jonas Maebe via fpc-pascal wrote: Is there anyway a function parameter could be inlined in FPC? This would go a long way in helping to parameterize functions that have tight loops in them. It's

Re: [fpc-pascal] String error on Windows

2021-11-01 Thread Sven Barth via fpc-pascal
Am 31.10.2021 um 12:20 schrieb Ryan Joseph via fpc-pascal: On Oct 31, 2021, at 2:53 PM, Jonas Maebe via fpc-pascal wrote: The compiler itself does enable them by the default on any platform. However, the fpc.cfg file that gets installed with FPC on all platforms does enable them by

Re: [fpc-pascal] String error on Windows

2021-10-31 Thread Sven Barth via fpc-pascal
Jonas Maebe via fpc-pascal schrieb am So., 31. Okt. 2021, 08:54: > On 31/10/2021 05:35, Ryan Joseph via fpc-pascal wrote: > > I thought they were behind a mode switch called "c operators" or > something but either way I don't see why Windows would disable them. > > The compiler itself does

Re: [fpc-pascal] Unable to link static lib files on Window

2021-10-26 Thread Sven Barth via fpc-pascal
Am 25.10.2021 um 22:38 schrieb Anthony Walter via fpc-pascal: I know I was previously able to link static library files on Windows with FPC, but hadn't used this feature in a while. When I recently tried using static linking I am receiving error messages leaving me to believe something has

Re: [fpc-pascal] Status of anonymous functions

2021-10-08 Thread Sven Barth via fpc-pascal
Luis Henrique Barbosa de Lima via fpc-pascal < fpc-pascal@lists.freepascal.org> schrieb am Fr., 8. Okt. 2021, 18:14: > Is there any progress or news about anonymous functions? I'm curious to > know if the development is alive and when/if it will land on trunk in near > future. > It's still work

Re: [fpc-pascal] TEnumerator - After the last element?

2021-10-07 Thread Sven Barth via fpc-pascal
Am 07.10.2021 um 16:10 schrieb Gabor Boros via fpc-pascal: Hi All, I need to know the current position is after the last element. The attached solution demonstrate what I want. Is an internal solution exists for this task? I not found anything. MoveNext returns False once the enumerator

Re: [fpc-pascal] How to list IP and MAC of network adapters on Windows?

2021-09-10 Thread Sven Barth via fpc-pascal
Bo Berglund via fpc-pascal schrieb am Fr., 10. Sep. 2021, 09:41: > Is there a way to enumerate the active adapters on a Windows computer with > their > IPv4 and MAC addresses? > There is an API for that, but I don't remember that right now. > I am trying to convert a Linux reporting script to

Re: [fpc-pascal] Raise exception in libray which will not halt host application

2021-08-26 Thread Sven Barth via fpc-pascal
Am 26.08.2021 um 12:59 schrieb LacaK via fpc-pascal: Am 26.08.2021 um 10:10 schrieb LacaK via fpc-pascal: Thank you for both answers! Please note that you won't be able to catch such an exception with the type from within the application, e.g.: === code begin === try  

Re: [fpc-pascal] Raise exception in libray which will not halt host application

2021-08-26 Thread Sven Barth via fpc-pascal
Am 26.08.2021 um 10:10 schrieb LacaK via fpc-pascal: Thank you for both answers! Please note that you won't be able to catch such an exception with the type from within the application, e.g.: === code begin === try   SomeLibraryFunction; except   on e: TMyObject do Whatever;   else    

Re: [fpc-pascal] FPC & Lazarus moving to gitlab

2021-07-13 Thread Sven Barth via fpc-pascal
Am 10.07.2021 um 16:14 schrieb Florian Klämpfl via fpc-pascal: There is a third conversion of the FPF repository meanwhile (from June): https://gitlab.com/freepascal.org/fpc/testconversion3  Please check and report any problems, this is

Re: [fpc-pascal] How does FPC perform in the FASTEST Computer Language Race

2021-07-11 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am So., 11. Juli 2021, 01:19: > > > > On Jul 10, 2021, at 11:18 AM, Jonas Maebe via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > A constexpr function means that it must be computable at compile time if > > all of its arguments are also

Re: [fpc-pascal] Tuples as variant arrays

2021-06-26 Thread Sven Barth via fpc-pascal
Am 26.06.2021 um 00:12 schrieb Ryan Joseph via fpc-pascal: Is it possible something like this could work? Seems like it should but I get an error (got MyRecord expected variant). {$mode objfpc} program unit_name; type TTuple = array of variant; type

Re: [fpc-pascal] Fwd: Linker error on simple program (windows)

2021-06-24 Thread Sven Barth via fpc-pascal
Am 24.06.2021 um 19:06 schrieb Bart via fpc-pascal: On Thu, Jun 24, 2021 at 11:10 AM Sven Barth wrote: Thus for 3.2.0 and 3.2.2 you indeed need to use the workarounds you mentioned. Not a problem. It just surprised me. Will this be fixed in 3.2.4? It's not even sure

Re: [fpc-pascal] Linker error on simple program (windows)

2021-06-24 Thread Sven Barth via fpc-pascal
Bart via fpc-pascal schrieb am Mi., 23. Juni 2021, 18:59: > The error goes away if I remove the inline directive from the function > definition in the interface section, or if I also declare the other > function (which gives the linker error) in the interface section. > The compiler shouldn't

Re: [fpc-pascal] Push rules

2021-06-22 Thread Sven Barth via fpc-pascal
Michael Van Canneyt via fpc-pascal schrieb am Di., 22. Juni 2021, 13:44: > > Hello, > > Martin asked how we intend to go about git commit authors/emails. > These can of course be manipulated at will in Git. > > But gitlab can place some restrictions on what is pushed to the repo: > >

Re: [fpc-pascal] Will the size of an executable depend on the uses clause

2021-06-16 Thread Sven Barth via fpc-pascal
Bo Berglund via fpc-pascal schrieb am Mi., 16. Juni 2021, 13:32: > On Wed, 16 Jun 2021 12:30:55 +0200, Mattias Gaertner via fpc-pascal > wrote: > > >> Since the final binary size after using strip -s on the exe file is > >> 271 kb it seems a bit big! > >> Or is there a lot behind the scenes I

Re: [fpc-pascal] Management operators memleaks

2021-06-13 Thread Sven Barth via fpc-pascal
Am 11.06.2021 um 18:15 schrieb denisgolovan via fpc-pascal: Hi all I created a test case for rather unusual behaviour of management operators in fpc 3.3.1. In some specific cases they produce memory leaks. I suspect it's some compiler issue. Could somebody take a look at

Re: [fpc-pascal] Option type

2021-06-02 Thread Sven Barth via fpc-pascal
denisgolovan via fpc-pascal schrieb am Mi., 2. Juni 2021, 13:28: > > > > Well as already discovered type like strings can not go into a "record > case" > > > > But... The above record is anyway of constant size. I.e. the memory for > > the field is always included, even if it is not used. > > >

Re: [fpc-pascal] Option type

2021-06-01 Thread Sven Barth via fpc-pascal
Am 02.06.2021 um 03:45 schrieb denisgolovan: You simply can't use managed types in a variant clause and as T could be a managed type the compiler does not allow it. Well. I thought it should be precisely the case for variant clause to properly handle. Compiler knows IsSome field is used to

Re: [fpc-pascal] Option type

2021-06-01 Thread Sven Barth via fpc-pascal
Am 01.06.2021 um 20:20 schrieb denisgolovan via fpc-pascal: Hi all I am trying to implement Option type in FPC. type generic TOption = record case IsSome:boolean of true: ( some: T ); false: (); end; However fpc just emits errors: Error: Type parameters may require

Re: [fpc-pascal] -FNsystem

2021-05-27 Thread Sven Barth via fpc-pascal
Mattias Gaertner via fpc-pascal schrieb am Do., 27. Mai 2021, 13:32: > Hi, > > There are some dotted units in fpc, e.g. system.uitypes. > So it would be nice to have -FNsystem in the default fpc.cfg (Delphi > compatible). > > What do you think? > While I agree that adding the namespaces might

Re: [fpc-pascal] FTP support gone - switch to HTTP ?

2021-05-18 Thread Sven Barth via fpc-pascal
Tomas Hajny via fpc-pascal schrieb am Di., 18. Mai 2021, 11:44: > On 2021-05-18 10:38, Michael Van Canneyt via fpc-pascal wrote: > > On Tue, 18 May 2021, Graeme Geldenhuys via fpc-pascal wrote: > > > >> > >> On 17/05/2021 3:13 pm, Karoly Balogh via fpc-pascal wrote: > >>> I'd actually keep > >>>

Re: [fpc-pascal] 50 years of Pascal, by the the author himself

2021-05-12 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Mi., 12. Mai 2021, 22:08: > > > > On May 12, 2021, at 12:30 PM, Ralf Quint via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Thought this was kind of interesting, though it leaves short of > mentioning the later Object Pascal evolution and

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

2021-04-29 Thread Sven Barth via fpc-pascal
James Richters schrieb am Do., 29. Apr. 2021, 10:33: > I get Error: Identifier not found “Try” > > Because my unit must be compiled with {$MODE TP} > You can try to use {$modeswitch exceptions}, I think. Otherwise quite a few procedures and functions won’t even compile that only > work in

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

2021-04-29 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

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 com

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 {$m

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

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

2021-04-27 Thread Sven Barth via fpc-pascal
Am 28.04.2021 um 00:53 schrieb Graeme Geldenhuys via fpc-pascal: On 27/04/2021 10:13 pm, Ryan Joseph via fpc-pascal wrote: value.SortEntities(function(a, b: TEntity): integer begin // do stuff end ); It seem the beginning of the thread is missing, but I

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

2021-04-27 Thread Sven Barth via fpc-pascal
Am 27.04.2021 um 19:56 schrieb Michael Van Canneyt via fpc-pascal: On Tue, 27 Apr 2021, Ryan Joseph via fpc-pascal wrote: On Apr 27, 2021, at 9:58 AM, Michael Van Canneyt wrote: Wait. I asked Sven to make sure that nested functions are under ALL circumstances usable as closures or

Re: [fpc-pascal] Generic constants with generic type

2021-04-21 Thread Sven Barth via fpc-pascal
Am 21.04.2021 um 17:59 schrieb Andrey Zubarev via fpc-pascal: Ok. Thanks! For this already there is a bug report? to notice when it will work? Best keep an eye on this one and then test again once it's solved: https://bugs.freepascal.org/view.php?id=25678 Regards, Sven

Re: [fpc-pascal] Generic constants with generic type

2021-04-21 Thread Sven Barth via fpc-pascal
Andrey Zubarev via fpc-pascal schrieb am Mi., 21. Apr. 2021, 09:23: > Hi all! > With the existing syntax of constants, it is good to pass array > boundaries, but bad to initial parameter values. What do you think about > such constructs: > > GTValue=... > It is currently simply not possible to

Re: [fpc-pascal] How does TFPGMap key compare work?

2021-04-20 Thread Sven Barth via fpc-pascal
Am 21.04.2021 um 00:09 schrieb Ryan Joseph via fpc-pascal: On Apr 20, 2021, at 3:10 PM, Sven Barth wrote: If you look at TFPSMap' code you'll see that BinaryCompareKey and BinaryCompareData are only used in the way of method pointers OnKeyPtrCompare and OnDataPtrCompare. In TFPGMap

Re: [fpc-pascal] How does TFPGMap key compare work?

2021-04-20 Thread Sven Barth via fpc-pascal
Am 19.04.2021 um 19:05 schrieb Ryan Joseph via fpc-pascal: I have a question I was just curious about. From what I can tell TFPGMap uses CompareByte to compare keys of arbitrary type, which is clever but how does this work for ShortStrings? I have tried to use this method myself and I find it

Re: [fpc-pascal] Abstract classes ignored

2021-04-18 Thread Sven Barth via fpc-pascal
Am 18.04.2021 um 19:58 schrieb Ryan Joseph via fpc-pascal: On Apr 18, 2021, at 5:00 AM, Sven Barth wrote: As I have said: Delphi compatibility. This would have been a good candidate to put behind the delphi mode switch but I'm sure there is a reason for this also. Nowadays: backwards

Re: [fpc-pascal] Separate release cycle for RTL and compiler proposal

2021-04-18 Thread Sven Barth via fpc-pascal
Am 18.04.2021 um 23:29 schrieb Zamrony P. Juhara via fpc-pascal: I would like to propose to separate RTL release   from compiler release so that RTL bug fixes and features can be released with shorter release cycle. Is that possible? No, the RTL and the compiler are tightly coupled. What

Re: [fpc-pascal] Abstract classes ignored

2021-04-18 Thread Sven Barth via fpc-pascal
Graeme Geldenhuys via fpc-pascal schrieb am So., 18. Apr. 2021, 17:54: > > On 18/04/2021 11:31 am, C Western via fpc-pascal wrote: > > but there are also case where it never makes sense to > > implement them and calling them indicates a logical error elsewhere in > > the code. > > So do the

Re: [fpc-pascal] Abstract classes ignored

2021-04-18 Thread Sven Barth via fpc-pascal
Jonas Maebe via fpc-pascal schrieb am So., 18. Apr. 2021, 21:19: > On 18/04/2021 18:08, Jonas Maebe via fpc-pascal wrote: > > In this case, you > > can easily make it an error yourself with {$warn 4046 error}. > > Correction: that's make it an error to construct a classes that contain > abstract

Re: [fpc-pascal] Abstract classes ignored

2021-04-18 Thread Sven Barth via fpc-pascal
Am 18.04.2021 um 04:34 schrieb Ryan Joseph via fpc-pascal: On Apr 17, 2021, at 3:09 PM, Sven Barth wrote: The compiler will generate a warning in case you instantiate a class that is abstract or has abstract methods. You can escalate these warnings to errors if you need: It's probably

Re: [fpc-pascal] Background info on Generics in FPC

2021-04-17 Thread Sven Barth via fpc-pascal
Am 17.04.2021 um 21:07 schrieb Graeme Geldenhuys via fpc-pascal: I'm looking at the wiki and official FPC language documentation. What was the reason for the decision to make the FPC syntax so verbose regarding Generics? I don't know what the original reason was, but nowadays it's main

Re: [fpc-pascal] Abstract classes ignored

2021-04-17 Thread Sven Barth via fpc-pascal
Am 17.04.2021 um 20:30 schrieb Ryan Joseph via fpc-pascal: From the documentation: "An abstract class is a class that cannot be instantiated directly. Instead, a descendent class must always be instantiated. However, for Delphi compatibility, the compiler ignores this directive." Why does

Re: [fpc-pascal] Generic class aliases

2021-04-16 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Fr., 16. Apr. 2021, 18:29: > With normal classes you can make aliases to other units but with generics > you get an error. Am I doing this wrong or is this not supported? > > type > TList = UOther.TList; // Generics without specialization cannot be used >

Re: [fpc-pascal] Interruption handling on i8086

2021-04-10 Thread Sven Barth via fpc-pascal
Am 10.04.2021 um 12:15 schrieb Guillermo via fpc-pascal: El Sat, 10 Apr 2021 10:42:12 +0200 Christo Crause escribió: On Sat, Apr 10, 2021 at 10:14 AM Guillermo via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: Hi pascaloids, I'm doing DOS development for fun and, after installing the

Re: [fpc-pascal] Usage of FieldAddress

2021-04-05 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Mo., 5. Apr. 2021, 05:58: > > > > On Apr 4, 2021, at 2:36 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > The RTTI streaming relies on *published properties* (and published > methods for

Re: [fpc-pascal] Usage of FieldAddress

2021-04-04 Thread Sven Barth via fpc-pascal
Am 04.04.2021 um 22:19 schrieb Ryan Joseph via fpc-pascal: On Apr 4, 2021, at 1:07 PM, Sven Barth via fpc-pascal wrote: Only classes or interfaces are supported as published *fields*. And the visibility of the *property* does not change the visibility of the *field*, after all

Re: [fpc-pascal] Usage of FieldAddress

2021-04-04 Thread Sven Barth via fpc-pascal
Am 04.04.2021 um 20:15 schrieb Ryan Joseph via fpc-pascal: On Apr 4, 2021, at 12:10 PM, Sven Barth via fpc-pascal wrote: FieldAddress only works on published fields. Just like MethodAddress only works on published methods. For private fields extended RTTI is required which is not yet

Re: [fpc-pascal] Usage of FieldAddress

2021-04-04 Thread Sven Barth via fpc-pascal
Am 04.04.2021 um 19:12 schrieb Ryan Joseph via fpc-pascal: I'm trying to see fields by name but TObject.FieldAddress doesn't seem to be working. Do I have that correct I should be using FieldAddress to return the pointer of the published property? Some how I can't seem to find an example of

Re: [fpc-pascal] Minimal size of compiled library (DLL under Windows)

2021-04-03 Thread Sven Barth via fpc-pascal
LacaK via fpc-pascal schrieb am Sa., 3. Apr. 2021, 13:22: > Hi, > I did small test project for library: > (with -CX -WR -O3 -Xs -XX options set) > > library library1; > {$mode objfpc}{$H+} > uses > SysUtils, Classes; > begin > end. > > Compilation produces DLL with size 200+ KB. > > When in

Re: [fpc-pascal] Extraneous generic parameters

2021-03-15 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Mo., 15. März 2021, 20:45: > > > > On Mar 15, 2021, at 12:42 AM, Sven Barth > wrote: > > > > The TArray generic type is part of the ObjPas unit, so the compiler > simply picks that instead of that of your program. ;) > >

Re: [fpc-pascal] Extraneous generic parameters

2021-03-15 Thread Sven Barth via fpc-pascal
Am 14.03.2021 um 19:10 schrieb Ryan Joseph via fpc-pascal: This program compiles, but is it a bug? I would think the specialization should fail because "S" in TArray is not specified. {$mode objfpc} type generic TArray = array of T; generic procedure

Re: [fpc-pascal] JSONStringToString question

2021-03-14 Thread Sven Barth via fpc-pascal
Michael Van Canneyt via fpc-pascal schrieb am So., 14. März 2021, 18:03: > > > On Sun, 14 Mar 2021, Bart via fpc-pascal wrote: > > > On Sun, Mar 14, 2021 at 4:15 PM Michael Van Canneyt via fpc-pascal > > wrote: > > > >> Fixed. Thanks for the patch. > >> There was a second issue, which is now

Re: [fpc-pascal] Smart-linking versus Whole Program Optimization

2021-03-10 Thread Sven Barth via fpc-pascal
LacaK via fpc-pascal schrieb am Mi., 10. März 2021, 10:34: > Hi, > > my goal is DO NOT include unused procedures, methods in final > program/library on Win32 target exe/dll. > > A.) I compile my (units) program/library with -CX -XX (set in Project > Options) > > B.) I did also experiments with

Re: [fpc-pascal] Unicode chars losing information

2021-03-08 Thread Sven Barth via fpc-pascal
Graeme Geldenhuys via fpc-pascal schrieb am Di., 9. März 2021, 00:56: > > On 07/03/2021 5:48 pm, Nikolay Nikolov via fpc-pascal wrote: > > It depends on what you mean by "just working". > > No, "just worked" is exactly what it says on the tin. It is FPC that > overcomplicating matters. > > > As

Re: [fpc-pascal] Why has the tkFloat default value changed?

2021-03-06 Thread Sven Barth via fpc-pascal
Ondrej Pokorny schrieb am Sa., 6. März 2021, 04:29: > On 05.03.2021 20:34, Sven Barth wrote: > > Am 28.02.2021 um 23:11 schrieb Mattias Gaertner via fpc-pascal: > > [...] > >> I can't find this change in > >> https://wiki.lazarus.freepascal.org/User_Chang

Re: [fpc-pascal] Why has the tkFloat default value changed?

2021-03-05 Thread Sven Barth via fpc-pascal
Am 28.02.2021 um 23:11 schrieb Mattias Gaertner via fpc-pascal: Hi, In FPC 3.2.0 the default "Default" value of a single/double property has changed from $8000 (fpc 3.0.4) to 0. This breaks TWriter. The $8000 means the property has no default value. Now FPC 3.2.0 no longer writes a

Re: [fpc-pascal] Strange output from make when building 3.2.0

2021-02-25 Thread Sven Barth via fpc-pascal
Am 25.02.2021 um 13:38 schrieb Bo Berglund via fpc-pascal: On Thu, 25 Feb 2021 10:59:14 +0100, Marco van de Voort via fpc-pascal wrote: Op 2021-02-25 om 10:12 schreef Bo Berglund via fpc-pascal: I am installing fpc 3.2.0 on a notebook running Ubuntu 20.04 LTS When I execute make clean and

Re: [fpc-pascal] Generic routines for both dynamic array and other collections

2021-02-22 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Mo., 22. Feb. 2021, 13:07: > > > > On Feb 21, 2021, at 2:59 PM, Sven Barth > wrote: > > > > You are supposed to use Length(X). There is no need for a "property". > One doesn't need to objectify each and

Re: [fpc-pascal] Traits Proposal

2021-02-22 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Mo., 22. Feb. 2021, 10:07: > > > > On Feb 19, 2021, at 8:50 AM, Ryan Joseph wrote: > > > > I just realized another potential problem. If we use the "default" > keyword that means there could be multiple "defaults" unless we limit the > property to 1 per

Re: [fpc-pascal] Generic routines for both dynamic array and other collections

2021-02-21 Thread Sven Barth via fpc-pascal
James Richters schrieb am Mo., 22. Feb. 2021, 01:07: > I've been using a lot of dynamic arrays of records lately, Some are even > Dynamic Arrays of records that contain other records, for example: > Type >XYZ_Record = Record > X,Y,Z : Double >End; > >Call_Stack_Record = Record

Re: [fpc-pascal] Generic routines for both dynamic array and other collections

2021-02-21 Thread Sven Barth via fpc-pascal
Am 21.02.2021 um 15:59 schrieb Ryan Joseph via fpc-pascal: On Feb 20, 2021, at 7:52 PM, Виктор Матузенко via fpc-pascal wrote: And how do I write generic helper for all possible dynamic arrays? By hand sadly. The RTL has added type helpers for many types but I don't think they added these

Re: [fpc-pascal] Questions from Semi-Beginner

2021-02-20 Thread Sven Barth via fpc-pascal
Am 20.02.2021 um 17:26 schrieb Tomas Hajny via fpc-pascal: On 2021-02-20 17:15, Tomas Hajny wrote: On 2021-02-20 13:49, Sven Barth via fpc-pascal wrote: CSlemaker via fpc-pascal schrieb am Sa., 20. Feb. 2021, 09:48: Hello everybody, Please, note that the original poster (in Cc: now, so

Re: [fpc-pascal] Questions from Semi-Beginner

2021-02-20 Thread Sven Barth via fpc-pascal
CSlemaker via fpc-pascal schrieb am Sa., 20. Feb. 2021, 09:48: > Will I need to recompile my Pascal source files for object compatibility > with Win 10? > Should I install the latest version of Free Pascal, and if so, which > version is that? > Will I have any compatibility problems with my

Re: [fpc-pascal] Traits Proposal

2021-02-19 Thread Sven Barth via fpc-pascal
Am 19.02.2021 um 20:37 schrieb Ryan Joseph via fpc-pascal: On Feb 19, 2021, at 11:01 AM, Sven Barth via fpc-pascal wrote: Your example is not quite correct and it's also not really complete: if a class implements an interface there *must* be a parent class mentioned (at least TObject

Re: [fpc-pascal] Traits Proposal

2021-02-19 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Fr., 19. Feb. 2021, 17:32: > Btw, here's point of reference for this other proposed syntax. > > https://github.com/genericptr/freepascal/wiki/Default-Implements-Property Your example is not quite correct and it's also not really complete: if a class

Re: [fpc-pascal] Traits Proposal

2021-02-18 Thread Sven Barth via fpc-pascal
Am 18.02.2021 um 23:58 schrieb Ryan Joseph via fpc-pascal: On Feb 18, 2021, at 3:07 PM, Sven Barth wrote: So "class type method resolution" is what's missing? I never used the interface method resolution so I don't really understand this feature. What needs to hap

Re: [fpc-pascal] Traits Proposal

2021-02-18 Thread Sven Barth via fpc-pascal
Am 17.02.2021 um 16:22 schrieb Ryan Joseph via fpc-pascal: On Feb 17, 2021, at 6:10 AM, Sven Barth wrote: Simply because no one has come around to implement it yet. The class type case is more complicated than the interface case. (Same would be true for record and objects) So, yes, we'll

Re: [fpc-pascal] interfaces and smartpointers [was Traits Proposal]

2021-02-18 Thread Sven Barth via fpc-pascal
Am 18.02.2021 um 02:25 schrieb Ryan Joseph via fpc-pascal: On Feb 17, 2021, at 4:51 PM, Benito van der Zander via fpc-pascal wrote: I benchmarked it years ago, I do not remember the details. But InitInterfacePointers was bad. Just look at it: That's not great for sure. Fillchar could be

Re: [fpc-pascal] Traits Proposal

2021-02-18 Thread Sven Barth via fpc-pascal
Am 18.02.2021 um 20:33 schrieb Martin Frb via fpc-pascal: could be written as   generic TTrait = class(T)     procedure Bar;   end;   TMyFoo = class(specialize TTrait) procedure Foo;   end; Of course that can get out of hand, if you want to include many traits. You need to constrain T

Re: [fpc-pascal] Traits Proposal

2021-02-17 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Mi., 17. Feb. 2021, 02:21: > > > > On Feb 16, 2021, at 3:35 PM, Benito van der Zander via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > But it is not calling the method, it is calling the wrapper function > > what you say wrapper function do

Re: [fpc-pascal] Traits Proposal

2021-02-17 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Mi., 17. Feb. 2021, 02:15: > > > > On Feb 16, 2021, at 2:43 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > FPC currently does not yet support class types not to mention records > and o

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Sven Barth via fpc-pascal
Benito van der Zander via fpc-pascal schrieb am Di., 16. Feb. 2021, 23:35: > Interfaces are not slow because they are are interfaces! When you call a > interface method it has the same costs as a virtual method call! And the > cost for reference counting that interfaces have right now would be

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Sven Barth via fpc-pascal
Am 16.02.2021 um 19:53 schrieb Ryan Joseph via fpc-pascal: On Feb 16, 2021, at 11:44 AM, Sven Barth wrote: I wasn't saying anything that contradicts this, only that the original mechanism of the delegation will be available even with the default modifier and this mechanism will in fact

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Di., 16. Feb. 2021, 19:21: > > > > There we have: > > > > * slower creation of the class, because each implemented interface adds > another VMT reference to the class which needs to be initialized. > > How bad is this? We need to make a test case we can

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Di., 16. Feb. 2021, 19:22: > > > > On Feb 15, 2021, at 11:41 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Again, the point of the interface would be to control which methods and > pro

Re: [fpc-pascal] Traits Proposal

2021-02-15 Thread Sven Barth via fpc-pascal
Am 14.02.2021 um 19:22 schrieb Ryan Joseph via fpc-pascal: On Feb 14, 2021, at 11:14 AM, Sven Barth via fpc-pascal wrote: It's a runtime conversion, but normally you don't do the conversion for every method call, but instead cache the interface (or work solely with the interface), thus

Re: [fpc-pascal] Traits Proposal

2021-02-15 Thread Sven Barth via fpc-pascal
Am 15.02.2021 um 18:08 schrieb Ryan Joseph via fpc-pascal: On Feb 15, 2021, at 9:08 AM, Marcos Douglas B. Santos via fpc-pascal wrote: As I understand, this is not a method hiding, but just to tell the compiler which method to implement the interface—the interface could have method names

Re: [fpc-pascal] Traits Proposal

2021-02-15 Thread Sven Barth via fpc-pascal
Am 15.02.2021 um 16:52 schrieb Ryan Joseph via fpc-pascal: On Feb 14, 2021, at 11:43 PM, Sven Barth via fpc-pascal wrote: Same names should be rejected. Providing a new implementation can be controlled using the interface alias: === code begin === type TMyClass = class

Re: [fpc-pascal] compiling on command line linux

2021-02-15 Thread Sven Barth via fpc-pascal
Am 15.02.2021 um 22:54 schrieb Alexander Grotewohl via fpc-pascal: There's a command line parameter.. try something like fpc -FU~/.units.lnx yourapp.pp Just to explain what -FUxxx does: this sets the unit output path. If you have precompiled units (or source files) in a different location

Re: [fpc-pascal] Traits Proposal

2021-02-14 Thread Sven Barth via fpc-pascal
Am 14.02.2021 um 19:03 schrieb Ryan Joseph via fpc-pascal: What it leaves desired: 1) Making a dummy interface is annoying boiler plate but not a deal breaker. Again, I see this is part of Pascal's declarativeness. Also this way you can make sure that only those methods/properties that you

Re: [fpc-pascal] Traits Proposal

2021-02-14 Thread Sven Barth via fpc-pascal
Am 14.02.2021 um 19:07 schrieb Ryan Joseph via fpc-pascal: On Feb 14, 2021, at 9:55 AM, Sven Barth via fpc-pascal wrote: No, interfaces by *themselves* don't mean that. An interface instance is merely a shifted Self pointer that points to the static VMT of which the entries correct

Re: [fpc-pascal] Traits Proposal

2021-02-14 Thread Sven Barth via fpc-pascal
Am 14.02.2021 um 02:45 schrieb Ryan Joseph via fpc-pascal: On Feb 13, 2021, at 12:38 PM, Sven Barth wrote: Right now, Ryan, your suggestion looks like a solution in search of a problem, or a "hey, look at that feature in language X, I so must have that in Pascal as well". Those con

Re: [fpc-pascal] Traits Proposal

2021-02-14 Thread Sven Barth via fpc-pascal
Am 14.02.2021 um 13:30 schrieb Michael Van Canneyt via fpc-pascal: On Sun, 14 Feb 2021, Sven Barth via fpc-pascal wrote: So whether it be this, or just an improvement on the Interfaces we already have, I'd definitely personally be in favor of something that "works like Interfaces e

Re: [fpc-pascal] Traits Proposal

2021-02-14 Thread Sven Barth via fpc-pascal
Am 14.02.2021 um 01:09 schrieb Ben Grasset via fpc-pascal: This seems possibly a *little* too similar to the existing Interface type in Object Pascal, however, I *would* really like to see some kind of functionality that basically amounts to "has the same capabilities as Interfaces and works

Re: [fpc-pascal] Traits Proposal

2021-02-13 Thread Sven Barth via fpc-pascal
Am 10.02.2021 um 03:18 schrieb Ryan Joseph via fpc-pascal: We had talked about this some time ago and it's been rattling around in my brain so I wanted to write it down into a formal proposal where we can discuss it and hopefully agree upon a syntax. Everything is preliminary and tentative but

Re: [fpc-pascal] Statically linked-in fpc code

2021-02-05 Thread Sven Barth via fpc-pascal
Adriaan van Os via fpc-pascal schrieb am Fr., 5. Feb. 2021, 10:50: > Adriaan van Os via fpc-pascal wrote: > > Jonas Maebe via fpc-pascal wrote: > >> On 2021-02-05 09:24, Adriaan van Os via fpc-pascal wrote: > >>> It's crazy ! > >>> > >> > >> The

Re: [fpc-pascal] Patches for Issue #37906 - DNS over TCP

2021-01-30 Thread Sven Barth via fpc-pascal
Am 30.01.2021 um 10:30 schrieb Noel Duffy via fpc-pascal: On 30/01/21 9:45 pm, Michael Van Canneyt via fpc-pascal wrote: On Sat, 30 Jan 2021, Noel Duffy via fpc-pascal wrote: I've added patches to resolve issue #37906, DNS over TCP, to the bug tracker:

Re: [fpc-pascal] Unit testing for RTL packages

2021-01-24 Thread Sven Barth via fpc-pascal
Am 24.01.2021 um 20:58 schrieb Noel Duffy via fpc-pascal: On 24/01/21 11:53 pm, Sven Barth via fpc-pascal wrote: Am 24.01.2021 um 08:37 schrieb Noel Duffy via fpc-pascal: How should one go about adding unit tests to a package in the RTL? In many packages, for instance fcl-db, there is a tests

Re: [fpc-pascal] Unit testing for RTL packages

2021-01-24 Thread Sven Barth via fpc-pascal
Am 24.01.2021 um 08:37 schrieb Noel Duffy via fpc-pascal: How should one go about adding unit tests to a package in the RTL? In many packages, for instance fcl-db, there is a tests folder with fpcunit units and programs in them, and they're referenced in fpmake.pp as example programs, but

Re: [fpc-pascal] Question about System.Move()

2021-01-11 Thread Sven Barth via fpc-pascal
Benito van der Zander via fpc-pascal schrieb am Mo., 11. Jan. 2021, 15:26: > Hi, > > perhaps a safe, generic function for this copying could be added to the > RTL. Like: > > Procedure ManagedMove(const source: T;var dest: T;count: SizeInt); > In principle a good idea. However this is one of

Re: [fpc-pascal] Question about System.Move()

2021-01-10 Thread Sven Barth via fpc-pascal
Am 09.01.2021 um 18:23 schrieb Bart via fpc-pascal: On Sat, Jan 9, 2021 at 5:12 PM Yuriy Sydorov via fpc-pascal wrote: 2. Is it OK if the elements of the array are (or contain) managed types? You need to manually finalize/free elements which are overwritten before calling Move. So, if I

Re: [fpc-pascal] Question about System.Move()

2021-01-10 Thread Sven Barth via fpc-pascal
Am 09.01.2021 um 22:54 schrieb Bart via fpc-pascal: On Sat, Jan 9, 2021 at 8:14 PM Yuriy Sydorov via fpc-pascal wrote: So, I'll use a for loop to copy the data. I assume that doing Arr[Index] := Default(T) will also finalize the element if that element ismanaged? For class object instances

<    1   2   3   4   5   6   7   8   9   10   >