Re: [fpc-pascal] 2.1.1 new protected
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 as it is "solved" in delphi with helper classes (p215). > (Maybe we can also implement the strict version (p168)) > > http://info.borland.com/techpubs/delphi/Delphi2006/Reference.pdf > It seems that FPC 2.1.1 implements the behaviour of Delphi 2006 'strict protected' by default. In MSEgui I have the problem that there is too much low level stuff to fit in one unit and the dependences are too complex to be mapped into a simple class hierarchy. Up to time I did as follows to access low level elements of classes in other units: " implementation type TLowLevelClassInOtherUnit1 = class(TLowLevelClassInOtherUnit); procedure TLowLevelClassInThisUnit.DoSomething; begin TLowLevelClassInOtherUnit1 (InstanceOfTLowLevelClassInOtherUnit).DoSomethingProtected; end; " 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: " unit secondlowlevelunit; interface uses firstlowlevelunit,highlevelunit; friends//use appropriate keyword and notation firstlowlevelunit; " -> In "secondlowlevelunit" all protected class members of "firstlowlevelunit" are visible, protected class members of "highlevelunit" are visible in descendant classes. Martin ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] 2.1.1 new protected
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 something like as it is "solved" in delphi with helper classes (p215). (Maybe we can also implement the strict version (p168)) http://info.borland.com/techpubs/delphi/Delphi2006/Reference.pdf It seems that FPC 2.1.1 implements the behaviour of Delphi 2006 'strict protected' by default. I don't think so, the delphi 2006 strict syntax is more strict. The example you gave below is (afaik) still possible in FPC, which wouldn't if it was strict. Marc In MSEgui I have the problem that there is too much low level stuff to fit in one unit and the dependences are too complex to be mapped into a simple class hierarchy. Up to time I did as follows to access low level elements of classes in other units: " implementation type TLowLevelClassInOtherUnit1 = class(TLowLevelClassInOtherUnit); procedure TLowLevelClassInThisUnit.DoSomething; begin TLowLevelClassInOtherUnit1 (InstanceOfTLowLevelClassInOtherUnit).DoSomethingProtected; end; " 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: " unit secondlowlevelunit; interface uses firstlowlevelunit,highlevelunit; friends//use appropriate keyword and notation firstlowlevelunit; " -> In "secondlowlevelunit" all protected class members of "firstlowlevelunit" are visible, protected class members of "highlevelunit" are visible in descendant classes. Martin ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] [Fwd: bug in fpc 2.0.4 rc 2 (go32v2)?]
--- Begin Message --- Hello there, I think I have to report a bug. I have recently downloaded fpc 2.0.4 rc2 for dos (go32v2). I have downloaded the full zip package, including sources and docs. After installing the compiler, I tried out to compile and run some programs. Everytime I tried to run a program using the graph unit, an error occurred: The program would compile, but runnning the project always resulted in "run time error 216". All the other programs (those without the graph unit) would run flawlessly. I never encountered this problem with fpc 2.0.2. All programs, including these using the graph unit, work perfectly with fpc 2.0.2 go32v2. My system: PII 233, 256 MB RAM, Windows ME. Windows ME never showed up any problems regarding the go32v2 version with fpc 2.0.2. P.S. : I am not yet subscribed to any mailing list. --- End Message --- ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] 2.1.1 new protected
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 we can also implement the strict version (p168)) http://info.borland.com/techpubs/delphi/Delphi2006/Reference.pdf It seems that FPC 2.1.1 implements the behaviour of Delphi 2006 'strict protected' by default. I don't think so, the delphi 2006 strict syntax is more strict. The example you gave below is (afaik) still possible in FPC, which wouldn't if it was strict. strict is also implemented in FPC and it is more strict. Peter ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal