TFPGList and objects

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

TFPGList and objects

Free Pascal - General mailing list
Using objects in TFPGList is currently not possible because class operators are not supported in objects. I tried using global scope operators but they don't seem to work.

/usr/local/lib/fpc/3.3.1/units/x86_64-darwin/rtl/fgl.ppu:fgl.pp:988:50: error: Operator is not overloaded: "TInvocation" = "TInvocation"

I wanted it for other reasons but we can consider the patch now to add class operators to objects?

https://bugs.freepascal.org/view.php?id=36350

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TFPGList and objects

vojtech.cihak

There is TFPGObjectList for objects.

 

BTW, is FGL a good choice for generics? Some time ago Marco wrote here that FGL is moreless a technology demonstrator and Generics.Collection or other libraries should be used instead.

 

Thanks for reply

 

V.

 

______________________________________________________________
> Od: "Ryan Joseph via fpc-pascal" <[hidden email]>
> Komu: "FPC-Pascal users discussions" <[hidden email]>
> Datum: 28.05.2020 09:30
> Předmět: [fpc-pascal] TFPGList and objects
>

Using objects in TFPGList is currently not possible because class operators are not supported in objects. I tried using global scope operators but they don't seem to work.

/usr/local/lib/fpc/3.3.1/units/x86_64-darwin/rtl/fgl.ppu:fgl.pp:988:50: error: Operator is not overloaded: "TInvocation" = "TInvocation"

I wanted it for other reasons but we can consider the patch now to add class operators to objects?

https://bugs.freepascal.org/view.php?id=36350

Regards,
Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TFPGList and objects

Free Pascal - General mailing list
Am 28.05.2020 um 19:36 schrieb Vojtěch Čihák via fpc-pascal:

There is TFPGObjectList for objects.


Ryan is talking about TP style objects.

 

BTW, is FGL a good choice for generics? Some time ago Marco wrote here that FGL is moreless a technology demonstrator and Generics.Collection or other libraries should be used instead.

The advantage of FGL is that it is more lightweight, thus more usable for small scale projects. Generics.Collections on the other hand is more powerful and faster. For general desktop projects I'd suggest to use the latter as well.

Regards,
Sven

_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TFPGList and objects

Free Pascal - General mailing list


> On May 29, 2020, at 3:29 AM, Sven Barth via fpc-pascal <[hidden email]> wrote:
>
> Am 28.05.2020 um 19:36 schrieb Vojtěch Čihák via fpc-pascal:
>> There is TFPGObjectList for objects.
>
> Ryan is talking about TP style objects.

I had an array of records and I wanted to subclass the record which means I need to 1) not use TFPGList 2) change to a class and all the memory implications that come with that. If we could also objects to allow class operators then we can have a solution to this problem.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal