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-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] 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] 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] 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] 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] 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] 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 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 happen as far as the

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-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] 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-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-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] 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 everything! > > Yes but programmers tend to be

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] 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] 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] 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] 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] 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] 64 bit Linux syscall from 32 bit fpc program

2021-12-24 Thread Sven Barth via fpc-pascal
Rainer Stratmann via fpc-pascal schrieb am Fr., 24. Dez. 2021, 15:04: > Is it possible to make a direct 64 bit Linux syscall from a 32 bit fpc > programm? > No, because your program is running as a 32-bit process and thus only has access to the 32-bit space of syscalls. Why, what do you want

Re: [fpc-pascal] Is there a range limitation for the in operator?

2021-12-22 Thread Sven Barth via fpc-pascal
Bo Berglund via fpc-pascal schrieb am Mi., 22. Dez. 2021, 16:08: > So I wonder if there is a value range limitation for the arguments inside > an in > command like: > if a in [x..y] then > The right side of the in-operator is a set constructor. And sets may only contain up to 256 values.

Re: [fpc-pascal] Improved FPC JSON-RPC support

2021-12-29 Thread Sven Barth via fpc-pascal
Am 29.12.2021 um 12:22 schrieb wkitty42--- via fpc-pascal: On 12/29/21 4:54 AM, Michael Van Canneyt via fpc-pascal wrote: Translated to RPC: if you want speed, don't use HTTP or JSON. WST offers a binary protocol and plain TCP channel, it's bound to be much faster. i'm sorry... what is WST?

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,allowdefaultparas:=not(nf_isproperty in

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 would need to > be deferred until

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] 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] 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] 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] 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-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-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-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] 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] Getting Last User Input reliably

2021-12-05 Thread Sven Barth via fpc-pascal
James Richters via fpc-pascal schrieb am So., 5. Dez. 2021, 19:06: > Is there some way I can do {$Q-} before my check then restore it to > whatever it was before after it? (for example if it was already set to > {$Q-} in the compiler, I would not want to turn it back on) > Is there a way to do a

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 (and then

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] Crash on Windows for Aarch64 target

2022-01-13 Thread Sven Barth via fpc-pascal
Am 12.01.2022 um 14:37 schrieb Volo Zyko via fpc-pascal: Hello, Some time ago it was announced an experimental support for Windows on Aarch64 (namely in this post https://lists.freepascal.org/pipermail/fpc-pascal/2020-April/057762.html). I tried to build a dll with a proprietary code for

Re: [fpc-pascal] StrToInt is using ShortString buffer?

2022-01-12 Thread Sven Barth via fpc-pascal
DougC via fpc-pascal schrieb am Mi., 12. Jan. 2022, 15:20: > Alexey- > > You can always create such a function yourself, gain experience using it, > and share the source with us. That way others can gain experience with it > and maybe someday also ask for it to be added to the standard library.

Re: [fpc-pascal] StrToInt is using ShortString buffer?

2022-01-12 Thread Sven Barth via fpc-pascal
DougC schrieb am Mi., 12. Jan. 2022, 17:57: > So, are you saying the one cannot declare an IntToStr function with the > string represented by a PChar argument? Seems pretty straightforward to me. > > Isn't that what is being requested? > No, it's not. He's requesting to change the functions

Re: [fpc-pascal] StrToInt is using ShortString buffer?

2022-01-12 Thread Sven Barth via fpc-pascal
Bart via fpc-pascal schrieb am Mi., 12. Jan. 2022, 22:31: > On Wed, Jan 12, 2022 at 3:13 PM Michael Van Canneyt via fpc-pascal > wrote: > > > From the definition you can see it is a compilerproc function, meaning > that the > > compiler writes direct calls to this. > > To change the signature

Re: [fpc-pascal] Case statement for class introspection

2022-01-16 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Mo., 17. Jan. 2022, 02:38: > > > > On Jan 16, 2022, at 11:15 PM, Sven Barth > wrote: > > > > The class type already is a unique "ID" for each class type when doing > an equal comparison. You can essentially take the address of the VMT as the > constant

Re: [fpc-pascal] Case statement for class introspection

2022-01-17 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Mo., 17. Jan. 2022, 08:53: > > > > On Jan 17, 2022, at 1:55 PM, Sven Barth > wrote: > > > > Question then is how you get the VMT address as a constant at compile > time. > > > > I'll need to get back to you with that. > > > > I didn't test yet but I think

Re: [fpc-pascal] Case statement for class introspection

2022-01-17 Thread Sven Barth via fpc-pascal
Am 17.01.2022 um 13:58 schrieb Ryan Joseph via fpc-pascal: On Jan 17, 2022, at 5:09 PM, Sven Barth wrote: The VMT writer already does that, cause the VMT pointer is required for each constructor call. The pointer to the VMT table is just PVmt(self) right? If I make a program and do:

Re: [fpc-pascal] bug or feature?

2022-02-13 Thread Sven Barth via fpc-pascal
Michael Van Canneyt via fpc-pascal schrieb am So., 13. Feb. 2022, 09:47: > > > On Sun, 13 Feb 2022, Mattias Gaertner via fpc-pascal wrote: > > > On Sat, 12 Feb 2022 12:14:14 +0100 (CET) > > Michael Van Canneyt via fpc-pascal > > wrote: > > > >> On Sat, 12 Feb 2022, Mattias Gaertner via

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-15 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Di., 15. Feb. 2022, 08:34: > > > > On Feb 15, 2022, at 2:09 PM, Michael Van Canneyt via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > I've answered this question before: > > > > The "Reference to procedure" that will be part of anonymous >

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-15 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Di., 15. Feb. 2022, 15:02: > > > > On Feb 15, 2022, at 8:32 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > A function reference is simply an interface of which the Invoke method > c

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-15 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Di., 15. Feb. 2022, 13:16: > > > > On Feb 15, 2022, at 7:10 PM, Michael Van Canneyt > wrote: > > > > In Delphi it is not. In FPC it should be :-) > > Indeed should be but that's what I'm trying to figure out with how this is > implemented. > > Why wouldn't

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-15 Thread Sven Barth via fpc-pascal
Michael Van Canneyt via fpc-pascal schrieb am Di., 15. Feb. 2022, 15:29: > > > On Tue, 15 Feb 2022, Ryan Joseph via fpc-pascal wrote: > > > > > > >> On Feb 15, 2022, at 8:26 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: >

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-15 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Di., 15. Feb. 2022, 13:06: > > > > On Feb 15, 2022, at 3:32 PM, Michael Van Canneyt via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > I requested that this: > > > > procedure TMyObject.Demo; > > > > Procedure DoSub; > > begin > >

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-15 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Di., 15. Feb. 2022, 13:14: > > > > On Feb 15, 2022, at 5:15 PM, Sven Barth > wrote: > > > > It contains a capture object that backs the method. > > If nothing is captured and the right hand side is a direct function or > method pointer then the compiler

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-15 Thread Sven Barth via fpc-pascal
Am 15.02.2022 um 15:05 schrieb Ryan Joseph via fpc-pascal: On Feb 15, 2022, at 8:26 PM, Sven Barth via fpc-pascal wrote: It's relatively "easy" to implement assigning a nested function to function references. However assigning a nested function variable to a function referen

Re: [fpc-pascal] Broken code with PEEPHOLE & REGVAR

2022-03-11 Thread Sven Barth via fpc-pascal
Peter via fpc-pascal schrieb am Fr., 11. März 2022, 13:47: > I had a look at the assembler generated by 3.3.1 > > . > > # Var uix located in stack [rsp+83240] > movl%edx,%eax > movq%rax,83280(%rsp) > # Var AttackLoc *located in stack [rsp+83280]* > # [503] var > > . > >

Re: [fpc-pascal] Broken code with PEEPHOLE & REGVAR

2022-03-14 Thread Sven Barth via fpc-pascal
Peter via fpc-pascal schrieb am So., 13. März 2022, 22:58: > On 13/03/2022 18:19, Florian Klämpfl via fpc-pascal wrote: > > Thanks for tracking this down! I have cherry picked the commit to fixes. > > Great! It was a nasty bug. Good to see it fixed for the next release. > Would you please check

Re: [fpc-pascal] Broken code with PEEPHOLE & REGVAR

2022-03-10 Thread Sven Barth via fpc-pascal
Peter via fpc-pascal schrieb am Fr., 11. März 2022, 00:48: > Pleased to report that with version > "Free Pascal Compiler version 3.3.1-10685-gf6ac49a139-unpushed-dirty > [2022/03/08] for x86_64" > > it seems fine. > So it seems it was fixed in main at least. Now the interesting question is

Re: [fpc-pascal] Broken code with PEEPHOLE & REGVAR

2022-03-10 Thread Sven Barth via fpc-pascal
Peter via fpc-pascal schrieb am Do., 10. März 2022, 23:39: > There are four source files, around 250k, to compile this library. I can > supply them if anyone wants to investigate. > Is this sufficient for a bug report? Does anyone know of any existing > bugs like this? Maybe already fixed? >

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-16 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Mi., 16. Feb. 2022, 07:59: > > > > On Feb 16, 2022, at 2:46 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > // nested function/procedure/routine variable > > type > >

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-15 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Mi., 16. Feb. 2022, 03:14: > > > > On Feb 15, 2022, at 11:09 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > For a global function the compiler has to generate a wrapper that gets > rid of

Re: [fpc-pascal] bug or feature?

2022-02-12 Thread Sven Barth via fpc-pascal
Michael Van Canneyt via fpc-pascal schrieb am Sa., 12. Feb. 2022, 12:14: > > > On Sat, 12 Feb 2022, Mattias Gaertner via fpc-pascal wrote: > > > Hi, > > > > This can't be right, can it? > > > > type > > TBird = class > >procedure Fly; > > end; > > TEagle = TBird; // alias > > > >

Re: [fpc-pascal] RTLEventWaitFor

2022-04-05 Thread Sven Barth via fpc-pascal
Mattias Gaertner via fpc-pascal schrieb am Di., 5. Apr. 2022, 10:36: > On Tue, 5 Apr 2022 10:23:45 +0200 (CEST) > Michael Van Canneyt via fpc-pascal > wrote: > > >[...] > > RTLEventWaitFor uses WaitForSingleObject internally. > > > > According to this: > > > >

Re: [fpc-pascal] Case statement for class introspection

2022-01-18 Thread Sven Barth via fpc-pascal
Am 19.01.2022 um 02:48 schrieb Ryan Joseph via fpc-pascal: On Jan 18, 2022, at 5:28 AM, Sven Barth wrote: The values will have the same differences between each other upon each start so ideally this would work anyway, but if one also throws dynamic packages into the mix things would get

Re: [fpc-pascal] Interface section overload procedures are all public

2022-01-23 Thread Sven Barth via fpc-pascal
Bart via fpc-pascal schrieb am So., 23. Jan. 2022, 21:43: > On Sun, Jan 23, 2022 at 6:12 PM Rainer Stratmann via fpc-pascal > wrote: > > > // making only one procedure bugtest public in the interface section > > // makes all other bugtest procedures public as well! > > // Lazarus 2.0.0+dfsg-2 >

Re: [fpc-pascal] Strange behavior in generics.collections TDictionary

2022-01-26 Thread Sven Barth via fpc-pascal
Am 25.01.2022 um 18:48 schrieb Thomas Kurz via fpc-pascal: Consider the following code: *** PROGRAM project1; {$mode objfpc} {$longstrings on} // see output below {$modeswitch advancedrecords} USES Variants, Generics.Collections, SysUtils; TYPE TRecord = PACKED RECORD FID: NativeUInt;

Re: [fpc-pascal] Case statement for class introspection

2022-01-16 Thread Sven Barth via fpc-pascal
Am 16.01.2022 um 15:25 schrieb Ryan Joseph via fpc-pascal: On Jan 16, 2022, at 9:01 PM, Ryan Joseph wrote: case PtrUInt(o.ClassType) of 4500656856: writeln('TObject'); end; I may have spoken too soon and without thinking the through clearly (it's getting late here!). For this to

Re: [fpc-pascal] Macro expanding error

2022-01-25 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Mi., 26. Jan. 2022, 03:18: > I have this macro: > > {$define TCallback := TCallback2} > > which gives a long list of these errors. > > warning: Expanding of macros exceeds a depth of 16. > > What does this warning mean and how can I resolve it? > I did not

Re: [fpc-pascal] All methods vitrual ?

2023-10-16 Thread Sven Barth via fpc-pascal
Adriaan van Os via fpc-pascal schrieb am Mo., 16. Okt. 2023, 15:14: > > > That's absurd, there are many features in modes objfpc and macpas > > that don't compile with Delphi. > > > > > > That doesn't make it any less true. > > > > Also we won't add it anyway, so... 路‍♀️ > > Apperently,

Re: [fpc-pascal] operator := in mode delphi?

2023-10-25 Thread Sven Barth via fpc-pascal
the docs that I found that is not possible > Correct. Delphi does not support global operator overloads and not every feature that is available in FPC is made available in mode Delphi the main purpose of which is to compile Delphi code after all. Regards, Sven On 24/10/2023 23:51, Sven Barth via fpc-

Re: [fpc-pascal] Creating capturers

2023-11-02 Thread Sven Barth via fpc-pascal
Am 01.11.2023 um 06:18 schrieb Hairy Pixels via fpc-pascal: I'm curious how the capturer is created in the case of anonymous functions. I know the function needs to create a capturer when nested functions are declared but what happens if there is an anonymous function which is declared in the

Re: [fpc-pascal] Creating capturers

2023-11-03 Thread Sven Barth via fpc-pascal
Hairy Pixels schrieb am Fr., 3. Nov. 2023, 02:00: > > > > On Nov 2, 2023, at 1:44 PM, Sven Barth > wrote: > > > > Now for nested as well as anonymous routines the compiler determines > whether a capturer is required at the point that the nested or anonymous > routine is assigned to a function

Re: [fpc-pascal] Creating capturers

2023-11-03 Thread Sven Barth via fpc-pascal
Hairy Pixels schrieb am Fr., 3. Nov. 2023, 12:37: > > > > On Nov 3, 2023, at 2:08 PM, Sven Barth > wrote: > > > > By default the purpose of anonymous functions assigned to function > references *is* that they can escape their scope. This will not change, > because they were after all introduced

Re: [fpc-pascal] Creating capturers

2023-11-05 Thread Sven Barth via fpc-pascal
Hairy Pixels schrieb am Sa., 4. Nov. 2023, 15:48: > > > > On Nov 4, 2023, at 4:22 PM, Sven Barth > wrote: > > > > Then don't assign them every "frame". If you just keep them around then > they aren't more expensive than a virtual method call. > > And any other mechanism would involve the heap

Re: [fpc-pascal] Compiler probem?

2023-11-05 Thread Sven Barth via fpc-pascal
Paul Renaud via fpc-pascal schrieb am Sa., 4. Nov. 2023, 16:18: > Hi, I have a question about some code. > > The following code segment generated a compiler error when I compiled it > with... > > fpc Sample -Se -gl -al > > but not when it's compiled with... > > fpc Sample -Se -gl > > ... > Asm >

Re: [fpc-pascal] operator := in mode delphi?

2023-10-24 Thread Sven Barth via fpc-pascal
Martin Frb via fpc-pascal schrieb am Di., 24. Okt. 2023, 23:30: > Is there a modeswitch to enable it? > > > Because currently I am getting an error in mode delphi. > In mode Delphi it's called "Implicit" as Delphi does not support symbolic operator overloads. Regards, Sven >

Re: [fpc-pascal] Creating capturers

2023-11-04 Thread Sven Barth via fpc-pascal
Hairy Pixels schrieb am Sa., 4. Nov. 2023, 01:42: > > > > On Nov 3, 2023, at 8:31 PM, Sven Barth > wrote: > > > > If you need a catch all type, then you should use function references. > There is no need to invent yet another type. > > The only thing it can not handle is the assignment of

Re: [fpc-pascal] All methods vitrual ?

2023-10-10 Thread Sven Barth via fpc-pascal
Adriaan van Os via fpc-pascal schrieb am Mi., 11. Okt. 2023, 06:25: > Sven Barth via fpc-pascal wrote: > > Am 10.10.2023 um 11:18 schrieb Adriaan van Os via fpc-pascal: > >> > >>> > >>> - In the released compiler, if you remove all visibility sp

Re: [fpc-pascal] All methods vitrual ?

2023-10-09 Thread Sven Barth via fpc-pascal
Adriaan van Os via fpc-pascal schrieb am Mo., 9. Okt. 2023, 14:29: > Is there a trick to make (in mode macpas) all class methods implicitely > virtual ? I mean, without > adding the virtual keyword to all of them ? The reason is that I want to > create a tree view of the > class hierarchy with

Re: [fpc-pascal] All methods vitrual ?

2023-10-09 Thread Sven Barth via fpc-pascal
Adriaan van Os via fpc-pascal schrieb am Mo., 9. Okt. 2023, 15:44: > > Is there a trick to make (in mode macpas) all class methods implicitely > virtual ? I mean, without > > adding the virtual keyword to all of them ? The reason is that I want to > create a tree view of the > > class hierarchy

Re: [fpc-pascal] All methods vitrual ?

2023-10-10 Thread Sven Barth via fpc-pascal
Am 10.10.2023 um 11:18 schrieb Adriaan van Os via fpc-pascal: - In the released compiler, if you remove all visibility specifiers, you can   get a list by specifying {$M+} on your base object and then list all   published methods using the RTTI. My understanding is that I have to

Re: [fpc-pascal] All methods vitrual ?

2023-10-10 Thread Sven Barth via fpc-pascal
Am 10.10.2023 um 11:01 schrieb Adriaan van Os via fpc-pascal: Sven Barth via fpc-pascal wrote: No. Only those in the published section are part of the vMethodTable. And when compiled with $M+ the default visibility is changed from public to published. Also, I can get a list

Re: [fpc-pascal] All methods vitrual ?

2023-10-10 Thread Sven Barth via fpc-pascal
Am 10.10.2023 um 02:04 schrieb Adriaan van Os via fpc-pascal: Sven Barth via fpc-pascal wrote: No. Only those in the published section are part of the vMethodTable. And when compiled with $M+ the default visibility is changed from public to published. OK, but that means that by explicitely

Re: [fpc-pascal] Error: compilation raised exception internally

2023-10-21 Thread Sven Barth via fpc-pascal
Rafael Picanço via fpc-pascal schrieb am Sa., 21. Okt. 2023, 02:50: > Hi everyone, > > I am getting a strange error when compiling a project. I am really not > sure what is going on, because it occurs sometimes, consistently in some > lines of the code with calls to this static variable: > ... >

Re: [fpc-pascal] Error: compilation raised exception internally

2023-10-21 Thread Sven Barth via fpc-pascal
Thomas Kurz via fpc-pascal schrieb am Sa., 21. Okt. 2023, 19:22: > > An exception or an internal error during compilation should *always* be > > reported. > > Please also provide a minimal, self contained example that shows the > > problem. > > This is not always trivial because the internal

Re: [fpc-pascal] All methods vitrual ?

2023-10-14 Thread Sven Barth via fpc-pascal
Adriaan van Os via fpc-pascal schrieb am Fr., 13. Okt. 2023, 11:02: > Michael Van Canneyt via fpc-pascal wrote: > > > > > > On Wed, 11 Oct 2023, Adriaan van Os via fpc-pascal wrote: > > > >> Michael Van Canneyt via fpc-pascal wrote: > >> > >>> $M controls the inclusion of RTTI, i.e. it allows or

Re: [fpc-pascal] All methods vitrual ?

2023-10-15 Thread Sven Barth via fpc-pascal
Adriaan van Os via fpc-pascal schrieb am So., 15. Okt. 2023, 08:54: > Sven Barth via fpc-pascal wrote: > > There will be no new visibility specifiers for something like this. > > > > And yes, it affects compatibility, as that means that code using that > > f

Re: [fpc-pascal] free pascal compiler on Linux Red Hat for target motorola 68k

2023-10-14 Thread Sven Barth via fpc-pascal
LECUYER Philippe via fpc-pascal schrieb am Sa., 14. Okt. 2023, 15:16: > Hi, > > I search a free pascal cross compiler (for host Linux Red hat 7.x and > target Motorola 68k) > > I test the last 3.2.2 version but I doesn’t find the option for target > Motorola 68k (fpc –help) > > It’s run when I

Re: [fpc-pascal] Barriers semantics

2023-08-15 Thread Sven Barth via fpc-pascal
Jonas Maebe via fpc-pascal schrieb am Mo., 14. Aug. 2023, 21:02: > On 14/08/2023 18:19, denisgolovan via fpc-pascal wrote: > > Now we have "volatile" intrinsic for assignments in place, I'd like to > ask for another clarification. > > Just to make sure given your questions below: using volatile

Re: [fpc-pascal] Feature announcement: implicit generic function specializations

2022-04-22 Thread Sven Barth via fpc-pascal
Am 22.04.2022 um 15:48 schrieb Rainer Stratmann via fpc-pascal: Am Mittwoch, 20. April 2022, 19:15:15 CEST schrieb Sven Barth via fpc-pascal: This feature is enabled with the modeswitch ImplicitFunctionSpecialization and is for now not enabled by default as this has the potential to break

Re: [fpc-pascal] Feature announcement: implicit generic function specializations

2022-04-22 Thread Sven Barth via fpc-pascal
Am 22.04.2022 um 22:22 schrieb Mattias Gaertner via fpc-pascal: On Fri, 22 Apr 2022 20:51:56 +0200 Martin Frb via fpc-pascal wrote: [...] Well, I tested: It uses the type of the first Param. So it calls a function for both param of type Byte. The cardinal argument is converted. (potentially

Re: [fpc-pascal] Feature announcement: implicit generic function specializations

2022-04-22 Thread Sven Barth via fpc-pascal
Am 22.04.2022 um 20:51 schrieb Martin Frb via fpc-pascal: I created a little test program (see bottom of mail). And it gives a strange warning: Compile Project, Target: C:\Users\martin\AppData\Local\Temp\project1.exe: Success, Warnings: 1, Hints: 3 project1.lpr(67,52) Warning: Range check

[fpc-pascal] Feature announcement: implicit generic function specializations

2022-04-20 Thread Sven Barth via fpc-pascal
Dear FPC community, The FPC developers are pleased to announce the implementation of a new feature: implicit generic function specializations. This feature was implemented by Ryan Joseph, so thank you very much, Ryan. This feature allows you to use generic routines (functions, procedures,

Re: [fpc-pascal] Correct way for using TThread.ForceQueue?

2022-04-25 Thread Sven Barth via fpc-pascal
Am 25.04.2022 um 17:30 schrieb Michael Van Canneyt via fpc-pascal: On Mon, 25 Apr 2022, Thomas Kurz via fpc-pascal wrote: I cannot remember why, but a long time ago when learning Delphi 5 or 6, I have learned not to call the destructor from within any method of the class, only from outside. 

Re: [fpc-pascal] Feature announcement: implicit generic function specializations

2022-04-25 Thread Sven Barth via fpc-pascal
Hairy Pixels via fpc-pascal schrieb am Mo., 25. Apr. 2022, 10:58: > > > > On Apr 25, 2022, at 2:39 PM, Martin Frb via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Actually, it's dealing with SmallInt (or ShortInt). And if the > programmer does not know that, then it might be an

Re: [fpc-pascal] Feature announcement: implicit generic function specializations

2022-04-25 Thread Sven Barth via fpc-pascal
Mattias Gaertner via fpc-pascal schrieb am Mo., 25. Apr. 2022, 13:50: > > >[...] > > type > > generic TArrayHelper = type helper for array of T > > procedure Add(value: T); > > end; > > > > var > > a: array of integer; > > begin > > a.Add(1); // specialize TArrayHelper since the

Re: [fpc-pascal] Feature announcement: implicit generic function specializations

2022-04-23 Thread Sven Barth via fpc-pascal
Am 23.04.2022 um 00:42 schrieb Martin Frb via fpc-pascal: Possible one more / Though more of an optimization. If the code has multiple     Add(Int64(0), Int64(0)); then they will all use the same procedure (just break in the debugger and check the CRC). But if  one specialization is explicit

Re: [fpc-pascal] Feature announcement: implicit generic function specializations

2022-04-23 Thread Sven Barth via fpc-pascal
Am 22.04.2022 um 23:08 schrieb Rainer Stratmann via fpc-pascal: Am Freitag, 22. April 2022, 19:53:34 CEST schrieben Sie: Am 22.04.2022 um 15:48 schrieb Rainer Stratmann via fpc-pascal: Am Mittwoch, 20. April 2022, 19:15:15 CEST schrieb Sven Barth via fpc- pascal: We don't deal

Re: [fpc-pascal] Incompatible procedure types

2023-11-08 Thread Sven Barth via fpc-pascal
Hairy Pixels schrieb am Do., 9. Nov. 2023, 01:37: > > > > On Nov 8, 2023, at 1:50 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Please provide example code so that one can look at it. Such messages > without example ar

Re: [fpc-pascal] Feature Announcement: Function References and Anonymous Functions

2022-05-26 Thread Sven Barth via fpc-pascal
Am 27.05.2022 um 00:46 schrieb Mattias Gaertner via fpc-pascal: On Thu, 26 May 2022 21:47:06 +0200 Sven Barth via fpc-pascal wrote: As these two features are rather complicated there might still be a huge bundle of bugs lurking around so I ask you to test them to year heart's content

Re: [fpc-pascal] Feature Announcement: Function References and Anonymous Functions

2022-05-27 Thread Sven Barth via fpc-pascal
Marco van de Voort via fpc-pascal schrieb am Fr., 27. Mai 2022, 13:31: > > On 27-5-2022 00:46, Mattias Gaertner via fpc-pascal wrote: > > > >> As these two features are rather complicated there might still be a > >> huge bundle of bugs lurking around so I ask you to test them to year > >>

<    5   6   7   8   9   10   11   12   >