Recent

Author Topic: IEquatable<T> interface  (Read 2241 times)

denis.totoliciu

  • Jr. Member
  • **
  • Posts: 53
IEquatable<T> interface
« on: July 07, 2020, 12:37:14 pm »
Hello guys,

Tried to compile the JCL package from Project JEDI with FPC 3.0.4 and it raised an error that it could not find IEquitable IEquatable interface.
Searched for it in the whole RTL source code, but could not find it. This interface is declared in the System unit for Delphi.

In JCL it is used by generic container classes.
Would like to ask your opinion on the following:
1. Would such an interface fit in the FPC RTL?
or
2. Would it be more appropriate to declare it somewhere in the JCL?

Thank you!
« Last Edit: July 07, 2020, 01:13:45 pm by denis.totoliciu »

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: IEquatable<T> interface
« Reply #1 on: July 07, 2020, 01:01:03 pm »
1. yes, but not in 3.0.4. The release version is 3.2.0
2. no, if Delphi declares it in system, FPC will probably do that too.

I don't think IEquitable  is a valid interface, you want to equate not quit.

Also note a compatible JCL version for windows is already provided as standard
« Last Edit: July 07, 2020, 01:14:51 pm by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Sandokhane

  • Newbie
  • Posts: 5
Re: IEquatable<T> interface
« Reply #2 on: February 18, 2022, 06:31:33 pm »
Hello guys,

Tried to compile the JCL package from Project JEDI with FPC 3.0.4 and it raised an error that it could not find IEquitable IEquatable interface.
...

Hello ; is there any good news about compiling jcl with lazarus ?
because i have got the same error when trying .
« Last Edit: February 18, 2022, 06:33:11 pm by Sandokhane »

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: IEquatable<T> interface
« Reply #3 on: February 18, 2022, 08:54:02 pm »
It is standard and windows only....
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

nicanor

  • New Member
  • *
  • Posts: 17
Re: IEquatable<T> interface
« Reply #4 on: May 31, 2022, 11:46:01 pm »
Same here... I am using the trunk versions of fpc (>3.2.2) and lazarus (2.3) installed via fpcupdeluxe in windows. I searched the folders and files of lazarus and fpcsrc and could not find occurrences or declaration of this interface. References appear only in ccr where jcl is installed.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11453
  • FPC developer.
Re: IEquatable<T> interface
« Reply #5 on: June 01, 2022, 10:06:19 am »
Seems simple enough,

Code: Pascal  [Select][+][-]
  1. IEquatable<T>=interface
  2.                               function Equals(Value:T):boolean;
  3.                              end;

but I can't find a GUID for it in the Windows SDK. Or maybe a generic one doesn't need it, only the instances do ?

added later Ok, seems no GUID required, but needs to be converted to objfpc dialect (sigh). Committed to trunk, please test
« Last Edit: June 01, 2022, 11:02:38 am by marcov »

nicanor

  • New Member
  • *
  • Posts: 17
Re: IEquatable<T> interface
« Reply #6 on: June 01, 2022, 11:39:56 pm »
Looks like it worked!
I was able to compile the part of the JCL I needed so far...
It took several other adjustments, compilation directives etc... but compiled   :) .. Now I have to make it run! 
Thank you very much!

 

TinyPortal © 2005-2018