Re: [fpc-pascal] rtl-generics vs fgl

2017-03-19 Thread Graeme Geldenhuys
On 2017-03-19 18:00, Florian Klämpfl wrote:
> The "FPC way" is fgl, the delphi compatible way is rtl-generics.


Thanks everybody - very useful information. At least now I know when to
use which one.


Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Interface Inheritance Bug

2017-03-19 Thread African Wild Dog
2017-03-19 5:25 GMT-03:00 Sven Barth via fpc-pascal <
fpc-pascal@lists.freepascal.org>:

> Am 19.03.2017 05:07 schrieb "African Wild Dog" :
> >
> > Hello,
> >
> > Test env: debian jessie amd64 - fpc 3.0.2
> >
> > It seems free pascal have a bug when handling interface inheritance
> using generics.
> >
> > When i try to compile the unit bellow, i get this error:
> >
> > "interface_bug.pas(41,44) Error: Incompatible types: got
> "TImplementor" expected "IParentInterface LongInt>""
>
> I think this will happen with non-generic interfaces as well. So please
> test with those and if possible also with 3.1.1 and report a bug if
> necessary (preferable with a non-generic example, makes things easier to
> debug ;) ).
>
>
Bug confirmed on 3.1.1.
Issued as http://bugs.freepascal.org/view.php?id=31568.


Regards
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Generics Bug

2017-03-19 Thread African Wild Dog
2017-03-18 19:29 GMT-03:00 African Wild Dog :

> 2017-03-18 18:41 GMT-03:00 Sven Barth via fpc-pascal <
> fpc-pascal@lists.freepascal.org>:
>
> Nested specializations are currently not supported though they *might*
>> work with 3.1.1.
>>
>
> I will do test some tests with 3.1.1.  Thanks.
>
> Regards
>

I have tested with 3.1.1. Nested specializations works in 3.1.1.

Regards
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Interface Inheritance Bug

2017-03-19 Thread African Wild Dog
2017-03-19 15:20 GMT-03:00 Sven Barth via fpc-pascal <
fpc-pascal@lists.freepascal.org>:

> But without the cast you get the same error, yes?
>
> Regards,
> Sven
>
>
Yes, i need to cast.

Regards
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Interface Inheritance Bug

2017-03-19 Thread Sven Barth via fpc-pascal
Am 19.03.2017 17:55 schrieb "African Wild Dog" :
>
> 2017-03-19 5:25 GMT-03:00 Sven Barth via fpc-pascal <
fpc-pascal@lists.freepascal.org>:
>>
>> I think this will happen with non-generic interfaces as well. So please
test with those and if possible also with 3.1.1 and report a bug if
necessary (preferable with a non-generic example, makes things easier to
debug ;) ).
>
>
> With non-generic types there is a workaround: cast to parent interface:
>
> ...
>
> ParentImplementorInstance := TImplementor.Create as IParentInterface;

But without the cast you get the same error, yes?

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] rtl-generics vs fgl

2017-03-19 Thread Florian Klämpfl
Am 19.03.2017 um 10:10 schrieb Graeme Geldenhuys:
> Hi,
> 
> Sorry if this is a silly question, I didn't really follow Generics
> discussions in the past. If the "rtl-generics" package a replacement for
> the fgl unit?
> 
> Going forward (FPC 3.0.2+), which Generics code are we supposed to use?

The "FPC way" is fgl, the delphi compatible way is rtl-generics.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Interface Inheritance Bug

2017-03-19 Thread African Wild Dog
2017-03-19 5:25 GMT-03:00 Sven Barth via fpc-pascal <
fpc-pascal@lists.freepascal.org>:

> I think this will happen with non-generic interfaces as well. So please
> test with those and if possible also with 3.1.1 and report a bug if
> necessary (preferable with a non-generic example, makes things easier to
> debug ;) ).
>
>
With non-generic types there is a workaround: cast to parent interface:

...

ParentImplementorInstance := TImplementor.Create as IParentInterface;

..
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TThread.OnTerminate ?

2017-03-19 Thread fredvs
Hello.

> procedure DoTerminate; override; 

Yep, this is the working solution (finally i get it).

Many thanks Bart.

Fre;D




-
Many thanks ;-)
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/TThread-OnTerminate-tp5727888p5727915.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] rtl-generics vs fgl

2017-03-19 Thread Marco van de Voort
In our previous episode, Sven Barth via fpc-pascal said:
> > Sorry if this is a silly question, I didn't really follow Generics
> > discussions in the past. If the "rtl-generics" package a replacement for
> > the fgl unit?
> 
> The fgl unit is more lightweight while rtl-generics might provide better
> performance.

Performance is a multi edges sword anyway.

For a site that shows some benchmarking results for commonly used FPC hashes
(though actually more generic maps) see

http://forum.lazarus-ide.org/index.php/topic,34348.msg225877.html#msg225877

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TThread.OnTerminate ?

2017-03-19 Thread Bart
On 3/19/17, fredvs  wrote:

> I am loosed.

lost is probably the word you're looking for ;-)


> procedure OnTerminate(sender: Tobject); override;
> ...

try
procedure DoTerminate; override;

Bart
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Forward Generic Type Declaration Bug

2017-03-19 Thread Sven Barth via fpc-pascal
Am 19.03.2017 11:30 schrieb "Bart" :
>
> On 3/19/17, Sven Barth via fpc-pascal 
wrote:
>
> >> But it should not give an internal error.
> >
> > With that I agree. Would you please check with 3.1.1 and if it's still
the
> > case there report a bug so that this isn't forgotten?
>
> A quick search in the bugtracker for this IE showed:
> http://bugs.freepascal.org/view.php?id=26452 (Internal error
> 2012101001 with forward template declaration).
> It's the same issue I guess?

Yes. Thank you for checking.

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] rtl-generics vs fgl

2017-03-19 Thread Sven Barth via fpc-pascal
Am 19.03.2017 10:10 schrieb "Graeme Geldenhuys" <
mailingli...@geldenhuys.co.uk>:
>
> Hi,
>
> Sorry if this is a silly question, I didn't really follow Generics
> discussions in the past. If the "rtl-generics" package a replacement for
> the fgl unit?

The fgl unit is more lightweight while rtl-generics might provide better
performance.

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TThread.OnTerminate ?

2017-03-19 Thread fredvs
> procedure OnTerminate(sender: Tobject); ---> This solve all. 

Not sure. ;-(

Hello.

It is me again.

I am loosed.

If I do :

MyThread : = class(TThread);
...
procedure OnTerminate(sender: Tobject); override;
...

There is a error message:

Error: (3058) There is no method in an ancestor class to be overridden:
"OnTerminate(TObject);"

;-(

Fre;D





-
Many thanks ;-)
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/TThread-OnTerminate-tp5727888p5727910.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TThread.OnTerminate ?

2017-03-19 Thread fredvs
Oops, I did not see your answer.
Thanks Michael.

My original bug was that I did:

MyThread = class(TThread)
...
procedure OnTerminate ;
...

It was not working, of course because OnTerminate is a procedure of object:

procedure OnTerminate(sender: Tobject); ---> This solve all.

Fre;D




-
Many thanks ;-)
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/TThread-OnTerminate-tp5727888p5727909.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Forward Generic Type Declaration Bug

2017-03-19 Thread Bart
On 3/19/17, Bart  wrote:

> r35221 (a bit old maybe) gives an IE.

Still present in r35625 (today).

Bart
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Forward Generic Type Declaration Bug

2017-03-19 Thread Bart
On 3/19/17, Sven Barth via fpc-pascal  wrote:

>> But it should not give an internal error.
>
> With that I agree. Would you please check with 3.1.1 and if it's still the
> case there report a bug so that this isn't forgotten?

A quick search in the bugtracker for this IE showed:
http://bugs.freepascal.org/view.php?id=26452 (Internal error
2012101001 with forward template declaration).
It's the same issue I guess?

Bart
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Forward Generic Type Declaration Bug

2017-03-19 Thread Bart
On 3/19/17, Sven Barth via fpc-pascal  wrote:

> With that I agree. Would you please check with 3.1.1 and if it's still the
> case there report a bug so that this isn't forgotten?

r35221 (a bit old maybe) gives an IE.

Bart
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] rtl-generics vs fgl

2017-03-19 Thread Graeme Geldenhuys
Thank you Michael.

Regards,
  Graeme

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] rtl-generics vs fgl

2017-03-19 Thread Michael Van Canneyt



On Sun, 19 Mar 2017, Graeme Geldenhuys wrote:


Hi,

Sorry if this is a silly question, I didn't really follow Generics
discussions in the past. If the "rtl-generics" package a replacement for
the fgl unit?


No, it is for Delphi compatibility. It contains also more classes/templates.


Going forward (FPC 3.0.2+), which Generics code are we supposed to use?


You are free to choose either one. if you care about Delphi compatibility,
then you should use the units in rtl-generics.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] rtl-generics vs fgl

2017-03-19 Thread Graeme Geldenhuys
Hi,

Sorry if this is a silly question, I didn't really follow Generics
discussions in the past. If the "rtl-generics" package a replacement for
the fgl unit?

Going forward (FPC 3.0.2+), which Generics code are we supposed to use?


Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Interface Inheritance Bug

2017-03-19 Thread Sven Barth via fpc-pascal
Am 19.03.2017 05:07 schrieb "African Wild Dog" :
>
> Hello,
>
> Test env: debian jessie amd64 - fpc 3.0.2
>
> It seems free pascal have a bug when handling interface inheritance using
generics.
>
> When i try to compile the unit bellow, i get this error:
>
> "interface_bug.pas(41,44) Error: Incompatible types: got
"TImplementor" expected "IParentInterface""

I think this will happen with non-generic interfaces as well. So please
test with those and if possible also with 3.1.1 and report a bug if
necessary (preferable with a non-generic example, makes things easier to
debug ;) ).

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Forward Generic Type Declaration Bug

2017-03-19 Thread Sven Barth via fpc-pascal
Am 19.03.2017 00:02 schrieb "Bart" :
>
> On 3/18/17, Sven Barth via fpc-pascal 
wrote:
>
> > Forward declarations for generic types are not supported.
>
> But it should not give an internal error.

With that I agree. Would you please check with 3.1.1 and if it's still the
case there report a bug so that this isn't forgotten?

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Forward Generic Type Declaration Bug

2017-03-19 Thread Sven Barth via fpc-pascal
Am 18.03.2017 23:27 schrieb "African Wild Dog" :
>
> 2017-03-18 18:40 GMT-03:00 Sven Barth via fpc-pascal <
fpc-pascal@lists.freepascal.org>:
>>
>> Forward declarations for generic types are not supported.
>
> Are there plans for add suport for this in fpc 3.2?

No, there are not.

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal