Re: [fpc-pascal] Checking the validity of Format and friends at compile-time

2016-10-05 Thread Michael Schnell
On 05.10.2016 07:59, Sven Barth wrote: something like this definitely wouldn't become part of the compiler as that would mean an unnecessarily tight coupling between compiler and RTL not to mention that user code that uses "array of const" wouldn't necessarily benefit from it. GNU C does check

Re: [fpc-pascal] A serious Memleak using delegates/implements (was: Delegate Interface class does not seem to be referenced counted)

2016-10-05 Thread Martin Schreiber
On Thursday 06 October 2016 00:16:22 Tony Whyman wrote: > On 05/10/16 23:03, Graeme Geldenhuys wrote: > > Martin Schreiber recently mentioned in another Interface discussion that > > there is a very good reason he doesn’t use COM style interfaces… > > Reference Counting! > > Used properly reference

Re: [fpc-pascal] A serious Memleak using delegates/implements (was: Delegate Interface class does not seem to be referenced counted)

2016-10-05 Thread Marcos Douglas
On Wed, Oct 5, 2016 at 7:16 PM, Tony Whyman wrote: > > Reference counted interfaces allow you to create classes (and objects) that > behave in the same way as AnsiStrings. IMHO, a lot of standard packages > would be greatly improved if they used com interfaces. I agree with you 100%. Best regard

Re: [fpc-pascal] A serious Memleak using delegates/implements (was: Delegate Interface class does not seem to be referenced counted)

2016-10-05 Thread Marcos Douglas
On Wed, Oct 5, 2016 at 7:07 PM, Tony Whyman wrote: > >[...] > > No, if you explicitly free the provider class there will be no memleaks. My > point is that having to do this is counter-intuitive and easy to get wrong > - or to overlook cases where it is necessary. That is it, counter-intuitive a

Re: [fpc-pascal] A serious Memleak using delegates/implements (was: Delegate Interface class does not seem to be referenced counted)

2016-10-05 Thread Marcos Douglas
On Wed, Oct 5, 2016 at 7:03 PM, Graeme Geldenhuys wrote: > Martin Schreiber recently mentioned in another Interface discussion that > there is a very good reason he doesn’t use COM style interfaces… > Reference Counting! I understand you, but reference counting help us to write a better code, mor

Re: [fpc-pascal] A serious Memleak using delegates/implements (was: Delegate Interface class does not seem to be referenced counted)

2016-10-05 Thread Marcos Douglas
On Wed, Oct 5, 2016 at 6:51 PM, Graeme Geldenhuys wrote: > On 2016-10-05 16:26, Marcos Douglas wrote: >> Here is the output on my machine (Lazarus 1.7 r52880M FPC 3.0.1 >> i386-win32-win32/win64) > > Just so you know... bug or not, it seems to have the same behaviour as > with Delphi 7. Compiled w

Re: [fpc-pascal] A serious Memleak using delegates/implements (was: Delegate Interface class does not seem to be referenced counted)

2016-10-05 Thread Tony Whyman
On 05/10/16 23:03, Graeme Geldenhuys wrote: Martin Schreiber recently mentioned in another Interface discussion that there is a very good reason he doesn’t use COM style interfaces… Reference Counting! Used properly reference counted interfaces are very powerful and allow for some very elegant p

Re: [fpc-pascal] A serious Memleak using delegates/implements (was: Delegate Interface class does not seem to be referenced counted)

2016-10-05 Thread Tony Whyman
On 05/10/16 19:19, Marcos Douglas wrote: Hi Tony, On Wed, Oct 5, 2016 at 1:13 PM, Tony Whyman wrote: [...] 7. You are responsible for freeing the object that "provides" the delegated interface. But I'm working only using Interfaces. All variables are interfaces type. So, I can't free the ob

Re: [fpc-pascal] A serious Memleak using delegates/implements (was: Delegate Interface class does not seem to be referenced counted)

2016-10-05 Thread Graeme Geldenhuys
On 2016-10-05 16:26, Marcos Douglas wrote: > So, I coded a new example — more simpler, I think — to demonstrate the same > problem and prove that there is some wrong that is causing a memleak. Martin Schreiber recently mentioned in another Interface discussion that there is a very good reason he d

Re: [fpc-pascal] A serious Memleak using delegates/implements (was: Delegate Interface class does not seem to be referenced counted)

2016-10-05 Thread Graeme Geldenhuys
On 2016-10-05 22:51, Graeme Geldenhuys wrote: > In fact, > compiled with Delphi 7, the app doesn't quit at all. I had to Ctrl+C it. Ignore that bit... Looking at the code in detail I see there was a ReadLn statement at the end. Dope! :) Regards, Graeme ___

Re: [fpc-pascal] A serious Memleak using delegates/implements (was: Delegate Interface class does not seem to be referenced counted)

2016-10-05 Thread Graeme Geldenhuys
On 2016-10-05 16:26, Marcos Douglas wrote: > Here is the output on my machine (Lazarus 1.7 r52880M FPC 3.0.1 > i386-win32-win32/win64) Just so you know... bug or not, it seems to have the same behaviour as with Delphi 7. Compiled with D7 it has the exact same output. In fact, compiled with Delphi

Re: [fpc-pascal] A serious Memleak using delegates/implements (was: Delegate Interface class does not seem to be referenced counted)

2016-10-05 Thread Marcos Douglas
Hi Tony, On Wed, Oct 5, 2016 at 1:13 PM, Tony Whyman wrote: > > [...] > > 7. You are responsible for freeing the object that "provides" the delegated > interface. But I'm working only using Interfaces. All variables are interfaces type. So, I can't free the object myself. > Where do we go from

Re: [fpc-pascal] Checking the validity of Format and friends at compile-time

2016-10-05 Thread Michalis Kamburelis
2016-10-05 9:00 GMT+02:00 Maciej Izak : > > 2016-10-05 4:32 GMT+02:00 Michalis Kamburelis : >> >> For example, the call >> >> Format('%s', [123]) > > > I have a small hint (instead of answer). We have in mORMot / NewPascal in > SynCommons module nice function which works perfect in most of cases:

Re: [fpc-pascal] A serious Memleak using delegates/implements (was: Delegate Interface class does not seem to be referenced counted)

2016-10-05 Thread Tony Whyman
On 05/10/16 16:26, Marcos Douglas wrote: Tony Whyman had posted on August 10 a problem with the compiler using Delegates. He used a workaround to "solve" his problem and the thread died. Marcos, I believe I concluded that this could be a bug or feature. Either way it is a Bear Trap waiting f

[fpc-pascal] A serious Memleak using delegates/implements (was: Delegate Interface class does not seem to be referenced counted)

2016-10-05 Thread Marcos Douglas
Hi, Tony Whyman had posted on August 10 a problem with the compiler using Delegates. He used a workaround to "solve" his problem and the thread died. So, I coded a new example — more simpler, I think — to demonstrate the same problem and prove that there is some wrong that is causing a memleak.

Re: [fpc-pascal] Enabling IPv6 for freepascal.org domain

2016-10-05 Thread Michael Van Canneyt
On Tue, 4 Oct 2016, Graeme Geldenhuys wrote: To whom it may concern, That would be me. This image of Arnie (Arnold Schwarzenegger) describes it best. :-) https://cdn.meme.am/instances/59911439.jpg Could the powers that be, please enable IPv6 support for the freepascal.org domain. The H

Re: [fpc-pascal] LowerCase vs. UnicodeLowerCase

2016-10-05 Thread Graeme Geldenhuys
On 2016-10-05 08:11, LacaK wrote: > Now I understand what happens, but isn't it bit confusing ? Yup, I would agree, and if possible, one should be removed. Regards, Graeme ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freep

[fpc-pascal] LowerCase vs. UnicodeLowerCase

2016-10-05 Thread LacaK
Hi, I have this simple program (on Windows): uses Classes, SysUtils; var US: UnicodeString; begin US := 'ÁÉÍ'; writeln(LowerCase(US)); // prints ÁÉÍ writeln(UnicodeLowerCase(US)); // prints áéí end; Why first LowerCase() does nothing while second wroks as expected? Looking at sourc

Re: [fpc-pascal] Checking the validity of Format and friends at compile-time

2016-10-05 Thread Maciej Izak
2016-10-05 4:32 GMT+02:00 Michalis Kamburelis : > For example, the call > > Format('%s', [123]) > I have a small hint (instead of answer). We have in mORMot / NewPascal in SynCommons module nice function which works perfect in most of cases: FormatUTF8('%', [123], []); // same string '%' works