Re: [fpc-devel] Re: Class field reordering

2012-07-23 Thread Graeme Geldenhuys
On 22 July 2012 14:22, Hans-Peter Diettrich drdiettri...@aol.com wrote: The more I think about these problems, the more I see class helpers as the natural extension of the language, that allows to implement extensions which have not been foreseen by the class designers. At the risk of the

Re: [fpc-devel] Re: Class field reordering

2012-07-23 Thread Marco van de Voort
In our previous episode, Giuliano Colla said: As far as Guiliano's suggestion goes, then I rather use a cmdline option for that (when compiled with that option it is allows to access private fields), rather than syntax. (but I don't know if the PPU format actually contains enough info to

Re: [fpc-devel] Re: Class field reordering

2012-07-23 Thread Graeme Geldenhuys
Hi, On 23 July 2012 15:31, Ian Macintosh ian.macint...@igmac.co.uk wrote: the design concept to me. What Graeme is saying is 100% correct, but also the wrong way to design imho. I don't see it like that. I have developed thousands of classes, and huge frameworks. I often find a new case where

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Ivanko B
the users must compile the RTL for non Lazarus use. = Really , it needs FPC sources at user's side. Then a workaround - to maintain protected properties for private variables : private fldPrivate1: integer; fldPrivate2: string; [..] private prorerty Private1: integer read

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Hans-Peter Diettrich
Martin schrieb: On 21/07/2012 16:55, Ivanko B wrote: The problem now is that cracker classes can't be used in future anymore because of the new class field ordering optimisation, so I dared to ask. So, is it possible to design the new feature in such way that to have an option to

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Florian Klämpfl
Am 22.07.2012 00:23, schrieb Ivanko B: Why should lazarus people have less chances to mess with private fields? = AFAIK, they haven't to use any crackers up to now and it is a normal way for the mainstream - where complier IDE are maintained by same team FPC and Lazarus are not

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Sven Barth
Am 22.07.2012 09:24 schrieb Hans-Peter Diettrich drdiettri...@aol.com: Martin schrieb: On 21/07/2012 16:55, Ivanko B wrote: The problem now is that cracker classes can't be used in future anymore because of the new class field ordering optimisation, so I dared to ask. So, is it

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Michael Van Canneyt
On Sat, 21 Jul 2012, Florian Klämpfl wrote: Am 21.07.2012 23:06, schrieb Ivanko B: No, just reorder the fields so that they can be properly $IFDEFed as protected for nonLAZARUS and left (private) as is otherwise. Why should lazarus people have less chances to mess with private fields?

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Ivanko B
A (global) compiler option treat private as protected might be another solution. Same and less flexible than the {$ifdef nonLazarus} solution. What are the numbers of the issues worked around by the crackers? === The exact number isn't very important. For instance,

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Florian Klämpfl
Am 22.07.2012 10:44, schrieb Ivanko B: A (global) compiler option treat private as protected might be another solution. This is no solution but a hack. Same and less flexible than the {$ifdef nonLazarus} solution. What are the numbers of the issues worked around by the

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Michael Van Canneyt
On Sun, 22 Jul 2012, Florian Klämpfl wrote: Am 22.07.2012 10:44, schrieb Ivanko B: A (global) compiler option treat private as protected might be another solution. This is no solution but a hack. Same and less flexible than the {$ifdef nonLazarus} solution. What are the

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Martin Schreiber
On Sunday 22 July 2012 10:52:33 Michael Van Canneyt wrote: Numbers, not count. I want to know which bugs are worked around by crackers. That's easy: 0 bugs. Sorry, there where bugs in the past and there probably will be in the future. Martin needs the crackers for some mse* features.

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Jonas Maebe
On 22 Jul 2012, at 11:09, Martin Schreiber wrote: Which otherwise can't be implemented without changes in FPC or FCL. I don't dare to ask for changes so cracker classes were a workaround without to bother FPC team. Asking for changes to make base classes more flexible is not bothering us.

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Michael Van Canneyt
On Sun, 22 Jul 2012, Martin Schreiber wrote: On Sunday 22 July 2012 10:52:33 Michael Van Canneyt wrote: Numbers, not count. I want to know which bugs are worked around by crackers. That's easy: 0 bugs. Sorry, there where bugs in the past and there probably will be in the future. There

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Marco van de Voort
In our previous episode, Ivanko B said: Or an option: {$ifdef nonLazarus} protected ... {$else} private ... {$endif} Then MSEgui/FPgui/.. may be compiled with -DnonLazarus option Requires recompile, and a directive to turn said optimization off would then be better (and not carve up

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Ivanko B
Asking for changes to make base classes more flexible is not bothering us. It's a regular part of software development, and in the best case every user of FPC comes out ahead in the end thanks to the resulting changes. Hacking around the type system that results in certain optimizations becoming

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Ivanko B
directive to turn said optimization off == But everyone wants the optimization ! (sure without breaking consequences) 2012/7/22, Ivanko B ivankob4m...@gmail.com: Asking for changes to make base classes more flexible is not bothering us. It's a regular part of software

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Ivanko B
Alternatives we present are discarded as sub-optimal or not to your liking. Let me recapitulate: 1. You reject my solution for TField. 2. For TCollection.FItemClass I presented an alternative for your problem. 3. TParam.Bound turned out not to be a problem at all. == True but it

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Martin Schreiber
On Sunday 22 July 2012 11:28:22 Michael Van Canneyt wrote: On Sun, 22 Jul 2012, Martin Schreiber wrote: On Sunday 22 July 2012 10:52:33 Michael Van Canneyt wrote: Numbers, not count. I want to know which bugs are worked around by crackers. That's easy: 0 bugs. Sorry, there where

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Michael Van Canneyt
On Sun, 22 Jul 2012, Ivanko B wrote: Alternatives we present are discarded as sub-optimal or not to your liking. Let me recapitulate: 1. You reject my solution for TField. 2. For TCollection.FItemClass I presented an alternative for your problem. 3. TParam.Bound turned out not to be a

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Marco van de Voort
In our previous episode, Martin Schreiber said: Martin needs the crackers for some mse* features. That's because you don't just ask for changes. You ask for your own solutions to be implemented in FPC. I do not ask for my own solutions, I ask to move private FPC class fields and

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Jonas Maebe
On 22 Jul 2012, at 11:50, Martin Schreiber wrote: Sorry Michael, I do not trust that the effort is worth the outcome for me. You're really putting us between a rock and a hard place here. It's quite tempting to retort with the next time I'll just commit my changes and tell people to deal

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Martin Schreiber
On Sunday 22 July 2012 12:06:31 Jonas Maebe wrote: On 22 Jul 2012, at 11:50, Martin Schreiber wrote: Sorry Michael, I do not trust that the effort is worth the outcome for me. You're really putting us between a rock and a hard place here. It's quite tempting to retort with the next time

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Jonas Maebe
On 22 Jul 2012, at 12:40, Martin Schreiber wrote: The situation here is especial because I must convince Michael for things that is of use for MSEgui only and most likely for no use in Lazarus or contradicts his design principles. I don't think Lazarus doesn't need it would be a valid

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Joost van der Sluis
On Sun, 2012-07-22 at 12:53 +0200, Jonas Maebe wrote: On 22 Jul 2012, at 12:40, Martin Schreiber wrote: AFAIK TObject is the only class which depends on compiler magic? Are there other classes which can not be duplicated? Pretty much anything in the system and dialect units (objpas,

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Martin Schreiber
On Sunday 22 July 2012 12:53:43 Jonas Maebe wrote: I don't think it's the best. I'm also quite sure it will require more work from you in the long run, keeping them up to date and merging bug fixes and new features from FPC back into your fork. I doubt it, the experience shows the opposite.

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Jonas Maebe
On 22 Jul 2012, at 13:11, Joost van der Sluis wrote: On Sun, 2012-07-22 at 12:53 +0200, Jonas Maebe wrote: Pretty much anything in the system and dialect units (objpas, macpas, objc, iso7185) is/can be(come) tightly bound to the compiler. The rest should be safe. There are more, like

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Marco van de Voort
In our previous episode, Martin Schreiber said: I don't think it's the best. I'm also quite sure it will require more work from you in the long run, keeping them up to date and merging bug fixes and new features from FPC back into your fork. I doubt it, the experience shows the opposite.

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Ivanko B
Some fields are kept private to ensure that the terms of the contract can be met. Making them public/protected means that the terms of the contract can be broken by Developer A, when the code of developer B depends on the terms being rigorously enforced, and his code can go very wrong.

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Martin Schreiber
On Sunday 22 July 2012 13:53:28 Florian Klaempfl wrote: So classes.pp except for TObject is safe? Afaik yes. Exception is in sysutils (magic too ?), tobject is in objpas. Ah, yes. So whole classes unit is independent from compiler. Super. :-) I wouldn't bet on it though. Why not?

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Giuliano Colla
Il 22/07/2012 10:39, Michael Van Canneyt ha scritto: On Sat, 21 Jul 2012, Florian Klämpfl wrote: Am 21.07.2012 23:06, schrieb Ivanko B: No, just reorder the fields so that they can be properly $IFDEFed as protected for nonLAZARUS and left (private) as is otherwise. Why should lazarus

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Florian Klämpfl
Am 22.07.2012 23:02, schrieb Ivanko B: Then friend classes as C++ offers and wait for this feature were implemented before proceeding with the optimization :) I never saw a C++ class pretending to be somebodies friend. iirc friend classes must be defined in the class which elements shall be

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Marco van de Voort
In our previous episode, Florian Kl?mpfl said: Then friend classes as C++ offers and wait for this feature were implemented before proceeding with the optimization :) I never saw a C++ class pretending to be somebodies friend. iirc friend classes must be defined in the class which

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Giuliano Colla
Il 22/07/2012 23:15, Marco van de Voort ha scritto: In our previous episode, Florian Kl?mpfl said: Then friend classes as C++ offers and wait for this feature were implemented before proceeding with the optimization :) I never saw a C++ class pretending to be somebodies friend. iirc friend

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Hans-Peter Diettrich
Sven Barth schrieb: Should FPC provide a way to access private fields from any other code? Like recent Delphi versions allow by extended RTTI? shudder FPC will support extended RTTI sooner or later as well. Hopefully with better means to disable it. Finally class helpers

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Hans-Peter Diettrich
Michael Van Canneyt schrieb: The base classes expose a well-defined API. This API is a contract you make with the developers of descendent classes. Which you don't know when designing a base class. Some fields are kept private to ensure that the terms of the contract can be met. Making them

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Sven Barth
Am 22.07.2012 13:18 schrieb Martin Schreiber mse00...@gmail.com: On Sunday 22 July 2012 12:53:43 Jonas Maebe wrote: I don't think it's the best. I'm also quite sure it will require more work from you in the long run, keeping them up to date and merging bug fixes and new features from FPC

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Martin Schreiber
On Sunday 22 July 2012 15:22:44 Hans-Peter Diettrich wrote: Some fields are kept private to ensure that the terms of the contract can be met. Making them public/protected means that the terms of the contract can be broken by Developer A, when the code of developer B depends on the terms

Re: [fpc-devel] Re: Class field reordering

2012-07-22 Thread Sven Barth
Am 23.07.2012 06:31 schrieb Martin Schreiber mse00...@gmail.com: On Monday 23 July 2012 00:17:49 Sven Barth wrote: So classes.pp except for TObject is safe? TObject is defined in unit System... Yes, Iearned it, thanks. :-) I hadn't read the other mails yet that also contained an

Re: [fpc-devel] Re: Class field reordering

2012-07-21 Thread Ivanko B
The problem now is that cracker classes can't be used in future anymore because of the new class field ordering optimisation, so I dared to ask. == The guys, this point is important ! All the discussion members are right in their arguments (Martin's the community impatience to

Re: [fpc-devel] Re: Class field reordering

2012-07-21 Thread Martin
On 21/07/2012 16:55, Ivanko B wrote: The problem now is that cracker classes can't be used in future anymore because of the new class field ordering optimisation, so I dared to ask. So, is it possible to design the new feature in such way that to have an option to proceed using cracker

Re: [fpc-devel] Re: Class field reordering

2012-07-21 Thread Ivanko B
Or an option: {$ifdef nonLazarus} protected ... {$else} private ... {$endif} Then MSEgui/FPgui/.. may be compiled with -DnonLazarus option 2012/7/21, Ivanko B ivankob4m...@gmail.com: The problem now is that cracker classes can't be used in future anymore because of the new class field

Re: [fpc-devel] Re: Class field reordering

2012-07-21 Thread Florian Klämpfl
Am 21.07.2012 18:48, schrieb Martin: On 21/07/2012 16:55, Ivanko B wrote: The problem now is that cracker classes can't be used in future anymore because of the new class field ordering optimisation, so I dared to ask. So, is it possible to design the new feature in such way that to

Re: [fpc-devel] Re: Class field reordering

2012-07-21 Thread Ivanko B
I don't see cracker classes as valid code. = Then the FPC team should eliminate the need in such crackers - via either disabling (via licencing, prisoning etc) the impatient [mainly because of impatient customers] non-mainstreams (non-Lazarus) or meeting needs of the non-mainstreams (

Re: [fpc-devel] Re: Class field reordering

2012-07-21 Thread Florian Klämpfl
Am 21.07.2012 20:47, schrieb Ivanko B: I don't see cracker classes as valid code. = Then the FPC team should eliminate the need in such crackers - via either disabling (via licencing, prisoning etc) the impatient [mainly because of impatient customers] non-mainstreams

Re: [fpc-devel] Re: Class field reordering

2012-07-21 Thread Ivanko B
No, just reorder the fields so that they can be properly $IFDEFed as protected for nonLAZARUS and left (private) as is otherwise. Sure not every filed but those the non-mainstreams developers ask. This'll allow the non-mainstreams to start fixing right now. Florian, it's a huge headache for

Re: [fpc-devel] Re: Class field reordering

2012-07-21 Thread Ivanko B
Smth like the below: type TNonCrackableClass = class private fldPrivate1: integer; fldPrivate2: styring; {$ifndef nonLazarus} fldPrivate3: real; // for LAZARUS {$else} protected fldPrivate3: real; // for MSEgui/FPgui {$endif} protected fldProtected1: string public [..] end;

Re: [fpc-devel] Re: Class field reordering

2012-07-21 Thread Florian Klämpfl
Am 21.07.2012 23:06, schrieb Ivanko B: No, just reorder the fields so that they can be properly $IFDEFed as protected for nonLAZARUS and left (private) as is otherwise. Why should lazarus people have less chances to mess with private fields? Either we make them public for all or for nobody. Of

Re: [fpc-devel] Re: Class field reordering

2012-07-21 Thread Ivanko B
Why should lazarus people have less chances to mess with private fields? = AFAIK, they haven't to use any crackers up to now and it is a normal way for the mainstream - where complier IDE are maintained by same team so fixing any bugs is much more urgent than for no-mainstream. Either we

Re: [fpc-devel] Re: Class field reordering

2012-07-21 Thread Ivanko B
But for very base (not yet specialized) classes - a good idea. 2012/7/22, Ivanko B ivankob4m...@gmail.com: Why should lazarus people have less chances to mess with private fields? = AFAIK, they haven't to use any crackers up to now and it is a normal way for the mainstream - where

Re: [fpc-devel] Re: Class field reordering

2012-07-21 Thread Martin Schreiber
On Saturday 21 July 2012 23:57:50 Florian Klämpfl wrote: Am 21.07.2012 23:06, schrieb Ivanko B: No, just reorder the fields so that they can be properly $IFDEFed as protected for nonLAZARUS and left (private) as is otherwise. Why should lazarus people have less chances to mess with private

[fpc-devel] Re: Class field reordering

2012-07-19 Thread _-jane-_
In my opinion class field reordering is a great idea I often wished.When I need a definitive layout, I always use PACKED.Unfortunately PACKED is not allowed on all suitable places; there should be packed set/array/record/object/class.Furthermore there should be pseudo-fields/pragmas for packed

Re: [fpc-devel] Re: Class field reordering

2012-07-19 Thread Jonas Maebe
On 19 Jul 2012, at 12:21, _-jan...@web.de wrote: Unfortunately PACKED is not allowed on all suitable places; there should be packed set There's the {$packset xxx} directive you can use. /array/record/ packed array and packed record both exist. object/class. Both respect the current