Re: [fpc-devel] case is

2022-03-23 Thread Hairy Pixels via fpc-devel
> On Mar 24, 2022, at 7:21 AM, Michael Van Canneyt via fpc-devel > wrote: > > I am all for merging the implementation of Ryan, but this is not my domain, > so one of the compiler people needs to look at it. > FPC badly needs another reviewer or someone with authority otherwise. I’ve been wa

Re: [fpc-devel] case is

2022-03-23 Thread Hairy Pixels via fpc-devel
> On Mar 24, 2022, at 8:14 AM, Hairy Pixels wrote: > > Search for "Case statement for class introspection” and you see can the > little discussion we had about a potential speed up and why it wasn’t viable > so for now it’s just using a if-else statement with A.ClassType = B.ClassType > comp

Re: [fpc-devel] case is

2022-03-23 Thread Hairy Pixels via fpc-devel
> On Mar 23, 2022, at 10:09 PM, Stefan Glienke via fpc-devel > wrote: > > JEP 420 is hardly a misnomer because it is so much more than just type > checking in a switch statement - hence pattern matching. > You can see in the various examples that you can combine all kinds of boolean > expres

Re: [fpc-devel] case is

2022-03-23 Thread Hairy Pixels via fpc-devel
> On Mar 23, 2022, at 10:35 PM, Mattias Gaertner via fpc-devel > wrote: > > Forget Java. The point is, that its "case" can be more than mere > syntactic sugar. It could give a nice speed up and the compiler warns > about unreachable statements. Search for "Case statement for class introspect

[fpc-devel] MacOS/dwarf: Was there any change to how/when relocation info is included.

2022-03-23 Thread Martin Frb via fpc-devel
It appears with 3.2.2  the address of a global var in dwarf already contains the relocation. Since fpdebug, does not retrieve any relocation info from lldb, it does not adjust any addresses. But with 3.3.1 it seems different. https://forum.lazarus.freepascal.org/index.php?topic=58822.new#new

Re: [fpc-devel] case is

2022-03-23 Thread Michael Van Canneyt via fpc-devel
On Wed, 23 Mar 2022, Mattias Gaertner via fpc-devel wrote: On Wed, 23 Mar 2022 22:20:38 +0700 Hairy Pixels via fpc-devel wrote: [...] > Did you use multiple "is" or did you check for sorted and use one > loop? No it’s just like a the case of string syntax which checks for equality with C

Re: [fpc-devel] case is

2022-03-23 Thread Mattias Gaertner via fpc-devel
On Wed, 23 Mar 2022 22:20:38 +0700 Hairy Pixels via fpc-devel wrote: >[...] > > Did you use multiple "is" or did you check for sorted and use one > > loop? > > No it’s just like a the case of string syntax which checks for > equality with ClassType so the order does matter. Maybe it’s not > exa

Re: [fpc-devel] case is

2022-03-23 Thread Stefan Glienke via fpc-devel
JEP 420 is hardly a misnomer because it is so much more than just type checking in a switch statement - hence pattern matching. You can see in the various examples that you can combine all kinds of boolean expressions - C# has had this for quite a while and they are constantly improving it. That

Re: [fpc-devel] case is

2022-03-23 Thread Hairy Pixels via fpc-devel
> On Mar 23, 2022, at 10:13 PM, Mattias Gaertner via fpc-devel > wrote: > >> Lol I just implemented this and made a merge request but I haven’t >> heard back from anyone yet so it’s just sitting there…. >> >> I basically just copied the structure used for “case of string” in >> that it makes

Re: [fpc-devel] case is

2022-03-23 Thread Mattias Gaertner via fpc-devel
On Wed, 23 Mar 2022 22:00:05 +0700 Hairy Pixels via fpc-devel wrote: > Lol I just implemented this and made a merge request but I haven’t > heard back from anyone yet so it’s just sitting there…. > > I basically just copied the structure used for “case of string” in > that it makes if a big if-e

Re: [fpc-devel] case is

2022-03-23 Thread Hairy Pixels via fpc-devel
I just remembered now I tried to follow the procedure to rebase the branch like they wanted but I made a big mess of things (notice how it says 400+ changes). I don’t know went wrong but you can see the changes I made in the commit history but I’m not sure how to isolate them to make a diff. Dun

Re: [fpc-devel] case is

2022-03-23 Thread Hairy Pixels via fpc-devel
Lol I just implemented this and made a merge request but I haven’t heard back from anyone yet so it’s just sitting there…. I basically just copied the structure used for “case of string” in that it makes if a big if-else statement. https://gitlab.com/freepascal.org/fpc/source/-/merge_requests/1

[fpc-devel] case is

2022-03-23 Thread Mattias Gaertner via fpc-devel
Hi, I just stumbled over the new Java feature "Pattern Matching for switch". https://openjdk.java.net/jeps/420 IMO it is a misnomer, but it has some interesting ideas. Basically for Pascal it is a case block using the "is" operator. Pseudo code: procedure Fly(o: TObject); begin case o is T