Re: [fpc-devel] Generic class comparison operators

2021-04-21 Thread Ryan Joseph via fpc-devel
> On Apr 21, 2021, at 12:57 PM, Sven Barth via fpc-devel > wrote: > > You can only use global operators with objects. yes but not with *generic* objects. I find it very hard to understand why this is being blocked for objects. Without this there is no way to have *generic* record

Re: [fpc-devel] Generic class comparison operators

2021-04-21 Thread Sven Barth via fpc-devel
Am 21.04.2021 um 15:44 schrieb Benito van der Zander via fpc-devel: Hi,  what about overloading operators for OBJECTs? They do not conflict with any default operators. I expected this to work, but it did not compile:   type generic TXQHashset = object //(specialize TXQBaseHashmap)...    

Re: [fpc-devel] Generic class comparison operators

2021-04-21 Thread Sven Barth via fpc-devel
Am 21.04.2021 um 16:54 schrieb Ryan Joseph via fpc-devel: On Apr 18, 2021, at 1:37 AM, Sven Barth wrote: It has been decided back when operator overloads were introduced that they do not replace existing, built in operators. This decision still stands. And we see no reason to change that.

Re: [fpc-devel] Generic class comparison operators

2021-04-21 Thread Ryan Joseph via fpc-devel
> On Apr 18, 2021, at 1:37 AM, Sven Barth wrote: > > It has been decided back when operator overloads were introduced that they do > not replace existing, built in operators. This decision still stands. And we > see no reason to change that. This way a user can *rely* on what a certain >

Re: [fpc-devel] Generic class comparison operators

2021-04-21 Thread Ryan Joseph via fpc-devel
> On Apr 21, 2021, at 7:44 AM, Benito van der Zander via fpc-devel > wrote: > > Hi, > > what about overloading operators for OBJECTs? > > They do not conflict with any default operators. > > I expected this to work, but it did not compile: > > > > type generic TXQHashset = object

Re: [fpc-devel] Generic class comparison operators

2021-04-21 Thread Benito van der Zander via fpc-devel
Hi,  what about overloading operators for OBJECTs? They do not conflict with any default operators. I expected this to work, but it did not compile:   type generic TXQHashset = object //(specialize TXQBaseHashmap)...     class operator =(const a, b: TXQHashset): boolean;   end; Cheers,

Re: [fpc-devel] Generic class comparison operators

2021-04-18 Thread Sven Barth via fpc-devel
Ryan Joseph via fpc-devel schrieb am So., 18. Apr. 2021, 02:18: > Since I'm working on generics right now can we finally, at the very least, > allow class operators for comparison operators? This is literally the only > way for a generic class to override the = operator (along with some others)

Re: [fpc-devel] Generic class comparison operators

2021-04-17 Thread Ryan Joseph via fpc-devel
> On Apr 17, 2021, at 2:12 PM, Jonas Maebe via fpc-devel > wrote: > > The issue with allowing it for classes (generic or not) is that the the = > operator already has a meaning for them (pointer equality). I think in > general we don't allow overloading operators that have a built-in

Re: [fpc-devel] Generic class comparison operators

2021-04-17 Thread Jonas Maebe via fpc-devel
On 2021-04-17 22:02, Ryan Joseph via fpc-devel wrote: Since I'm working on generics right now can we finally, at the very least, allow class operators for comparison operators? This is literally the only way for a generic class to override the = operator (along with some others) so there's no