Re: [fpc-devel] Additional generic type constraints

2023-02-22 Thread Stefan Glienke via fpc-devel
> I think Delphi basically has the same constraints as C# Not quite (well maybe back then when they implemented them but C# improved since)- also they are subtly implemented differently. In C# the constraint *class* means "a reference type" - in Delphi it actually means it has to be a class.

Re: [fpc-devel] Additional generic type constraints

2023-02-22 Thread denisgolovan via fpc-devel
> It does seem incomplete that you can’t make a generic constrained for string > types for example. Why don’t more languages have that? It seems like an > obvious feature which should be supported. Rust & Haskell do that. But that's another story :) -- Regards, Denis Golovan

Re: [fpc-devel] Additional generic type constraints

2023-02-22 Thread Hairy Pixels via fpc-devel
> On Feb 22, 2023, at 8:11 PM, Sven Barth via fpc-devel > wrote: > > Some additional constraints might be added. However I have none of them > planned currently and enough other things to do. > I think Delphi basically has the same constraints as C# so FPC is in that same category. Swift

Re: [fpc-devel] Additional generic type constraints

2023-02-22 Thread Sven Barth via fpc-devel
Kostas Michalopoulos via fpc-devel schrieb am Mi., 22. Feb. 2023, 10:37: > > Because Delphi doesn't have them and when constraints were implemented > > they were implemented for Delphi compatibility. > > Can they be added? The original announcement ~13 years ago mentioned > that those could be

Re: [fpc-devel] Additional generic type constraints

2023-02-22 Thread Kostas Michalopoulos via fpc-devel
Because Delphi doesn't have them and when constraints were implemented they were implemented for Delphi compatibility. Can they be added? The original announcement ~13 years ago mentioned that those could be added at some point. "object" and "operator X" would be quite useful for me. I