Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2020-05

TFPGList and objects

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ryan Joseph

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

Reply by email

Vojtěch Čihák
to Ryan Joseph

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

Show quoted text 5 lines
Od: "Ryan Joseph via fpc-pascal" Komu: "FPC-Pascal users discussions" 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 <https://bugs.freepascal.org/view.php?id=36350>

Regards,
Ryan Joseph

Reply by email

Sven Barth
to Vojtěch Čihák
Vojtěch Čihák wrote
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

Reply by email

Ryan Joseph
to Sven Barth
Show quoted text 6 lines
On May 29, 2020, at 3:29 AM, Sven Barth via fpc-pascal 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

Reply by email