Re: [fpc-pascal] 2.1.1 new protected

2006-08-14 Thread Marco van de Voort
It is ugly, produces warnings and is possibly forbidden in FPC 2.1.1 (I don't know). A more elegant solution would be to have something like 'friend units' where protected class members are visible: I wonder what the use of making a private/public/protected distinction is in the first place,

Re: [fpc-pascal] 2.1.1 new protected

2006-08-14 Thread Florian Klaempfl
Marco van de Voort wrote: It is ugly, produces warnings and is possibly forbidden in FPC 2.1.1 (I don't know). A more elegant solution would be to have something like 'friend units' where protected class members are visible: I wonder what the use of making a private/public/protected

Re: [fpc-pascal] 2.1.1 new protected

2006-08-14 Thread Martin Schreiber
On Sunday 13 August 2006 13.27, Marco van de Voort wrote: It is ugly, produces warnings and is possibly forbidden in FPC 2.1.1 (I don't know). A more elegant solution would be to have something like 'friend units' where protected class members are visible: I wonder what the use of making a

Re: [fpc-pascal] 2.1.1 new protected

2006-08-14 Thread Michael Van Canneyt
On Mon, 14 Aug 2006, Martin Schreiber wrote: On Sunday 13 August 2006 13.27, Marco van de Voort wrote: It is ugly, produces warnings and is possibly forbidden in FPC 2.1.1 (I don't know). A more elegant solution would be to have something like 'friend units' where protected class members are

Re: [fpc-pascal] 2.1.1 new protected

2006-08-14 Thread memsom
No. It just means the classes are designed wrong. Very true. There are a number of places in Delphi's VCL where this is true... for D5 at least. If you need to access directly private class fields, I think there are serious design flaws in your code. Class crackers only give access to

Re: [fpc-pascal] 2.1.1 new protected

2006-08-12 Thread Martin Schreiber
On Friday 11 August 2006 20.35, Marc Weustink wrote: What's the alternative? To have most of internal procedures public with a comment for internal use only, I really don't like it, or to have all code in a single file, I don't like it too. What about friend units'? Or something like

Re: [fpc-pascal] 2.1.1 new protected

2006-08-12 Thread Marc Weustink
Martin Schreiber wrote: On Friday 11 August 2006 20.35, Marc Weustink wrote: What's the alternative? To have most of internal procedures public with a comment for internal use only, I really don't like it, or to have all code in a single file, I don't like it too. What about friend units'? Or

Re: [fpc-pascal] 2.1.1 new protected

2006-08-12 Thread Peter Vreman
What's the alternative? To have most of internal procedures public with a comment for internal use only, I really don't like it, or to have all code in a single file, I don't like it too. What about friend units'? Or something like as it is solved in delphi with helper classes (p215). (Maybe

Re: [fpc-pascal] 2.1.1 new protected

2006-08-11 Thread Florian Klaempfl
Mattias Gaertner wrote: Recently the behaviour of the 'protected' keyword has changed in fpc 2.1.1. Now I wonder how can I fix the code, that depends on this. Redesign :) I have some base classes, that defines methods to let derived classes interact. These methods should not be accessed

Re: [fpc-pascal] 2.1.1 new protected

2006-08-11 Thread Michael Van Canneyt
On Fri, 11 Aug 2006, Florian Klaempfl wrote: Mattias Gaertner wrote: Recently the behaviour of the 'protected' keyword has changed in fpc 2.1.1. Now I wonder how can I fix the code, that depends on this. Redesign :) I have some base classes, that defines methods to let derived classes

Re: [fpc-pascal] 2.1.1 new protected

2006-08-11 Thread Jonas Maebe
On 11 aug 2006, at 13:35, Mattias Gaertner wrote: I have some base classes, that defines methods to let derived classes interact. These methods should not be accessed directly from the outside, so they are protected. But this does not work any longer. Of course I can safely typecast, but

Re: [fpc-pascal] 2.1.1 new protected

2006-08-11 Thread Florian Klaempfl
Michael Van Canneyt wrote: On Fri, 11 Aug 2006, Florian Klaempfl wrote: Mattias Gaertner wrote: Recently the behaviour of the 'protected' keyword has changed in fpc 2.1.1. Now I wonder how can I fix the code, that depends on this. Redesign :) I have some base classes, that defines

Re: [fpc-pascal] 2.1.1 new protected

2006-08-11 Thread Mattias Gaertner
On Fri, 11 Aug 2006 13:42:49 +0200 Florian Klaempfl [EMAIL PROTECTED] wrote: Mattias Gaertner wrote: Recently the behaviour of the 'protected' keyword has changed in fpc 2.1.1. Now I wonder how can I fix the code, that depends on this. Redesign :) Of FPC? Naaah, too much work. ;) Of my

Re: [fpc-pascal] 2.1.1 new protected

2006-08-11 Thread Michael Van Canneyt
On Fri, 11 Aug 2006, Florian Klaempfl wrote: Michael Van Canneyt wrote: On Fri, 11 Aug 2006, Florian Klaempfl wrote: Mattias Gaertner wrote: Recently the behaviour of the 'protected' keyword has changed in fpc 2.1.1. Now I wonder how can I fix the code, that depends on this. Redesign

Re: [fpc-pascal] 2.1.1 new protected

2006-08-11 Thread Martin Schreiber
On Friday 11 August 2006 13.58, Mattias Gaertner wrote: On Fri, 11 Aug 2006 13:42:49 +0200 Florian Klaempfl [EMAIL PROTECTED] wrote: Mattias Gaertner wrote: Recently the behaviour of the 'protected' keyword has changed in fpc 2.1.1. Now I wonder how can I fix the code, that depends on

Re: [fpc-pascal] 2.1.1 new protected

2006-08-11 Thread Graeme Geldenhuys
I managed to Copy and Paste the text, for thouse that can't view the attached image from my previous post... --- A private member is invisible outside of the unit or program where its class is declared. In other words, a private method cannot be called from another

Re: [fpc-pascal] 2.1.1 new protected

2006-08-11 Thread Alexandre Leclerc
2006/8/11, Mattias Gaertner [EMAIL PROTECTED]: On Fri, 11 Aug 2006 14:49:16 +0200 Graeme Geldenhuys [EMAIL PROTECTED] wrote: On 8/11/06, Michael Van Canneyt [EMAIL PROTECTED] wrote: It seems normal to me that it is not just the current instance. You KNOW this method is there, in a

Re: [fpc-pascal] 2.1.1 new protected

2006-08-11 Thread Graeme Geldenhuys
On 8/11/06, Mattias Gaertner [EMAIL PROTECTED] wrote: Where do you read here anything about 'current instance'? Maybe not in that snippet of text, but I read it somewhere... ;-) And it was very Delphi compatible. I mean, how many Delphians noticed the difference at all? It didn't hurt and

Re: [fpc-pascal] 2.1.1 new protected

2006-08-11 Thread Mattias Gaertner
On Fri, 11 Aug 2006 15:45:00 +0200 Graeme Geldenhuys [EMAIL PROTECTED] wrote: On 8/11/06, Mattias Gaertner [EMAIL PROTECTED] wrote: Where do you read here anything about 'current instance'? Maybe not in that snippet of text, but I read it somewhere... ;-) :) And it was very Delphi

Re: [fpc-pascal] 2.1.1 new protected

2006-08-11 Thread Graeme Geldenhuys
On 8/11/06, Mattias Gaertner [EMAIL PROTECTED] wrote: Thanks for the good example. With the protected method you can easily do dangerous things, like adding an action twice or forgetting to remove it. With the 'protected' AddAction you could do such things only with dirty tricks like the

Re: [fpc-pascal] 2.1.1 new protected

2006-08-11 Thread Marc Weustink
Martin Schreiber wrote: On Friday 11 August 2006 13.58, Mattias Gaertner wrote: On Fri, 11 Aug 2006 13:42:49 +0200 Florian Klaempfl [EMAIL PROTECTED] wrote: Mattias Gaertner wrote: Recently the behaviour of the 'protected' keyword has changed in fpc 2.1.1. Now I wonder how can I fix the