> 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.
> 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
> 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
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
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