Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-24 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Di., 24. Apr. 2018, 10:44: > > > > On Apr 24, 2018, at 12:48 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Because that is how helper currently work. Extending it with a new > feature will not change that. > > > > I made an example to see

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-24 Thread Ryan Joseph
> On Apr 24, 2018, at 12:48 PM, Sven Barth via fpc-pascal > wrote: > > Because that is how helper currently work. Extending it with a new feature > will not change that. > I made an example to see how this would look. What’s the problem with “last in wins” like seen below? Seems pretty st

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-23 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Di., 24. Apr. 2018, 04:03: > > > > On Apr 24, 2018, at 12:57 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > As I said the problem arises when inheritance enters the field as the > rules are a bit different there. > > > > Why should helper

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-23 Thread Ryan Joseph
> On Apr 24, 2018, at 12:57 AM, Sven Barth via fpc-pascal > wrote: > > As I said the problem arises when inheritance enters the field as the rules > are a bit different there. > Why should helper methods be allowed to redefine existing methods anyways? As I mentioned Swift/ObjC don’t even

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-23 Thread Sven Barth via fpc-pascal
LacaK schrieb am Mo., 23. Apr. 2018, 15:22: > > > >> Is planned support for multiple class(objet, record) helpers in a way, >> that all class helpers can be used in parallel not only one? >> > > Yes, it is planned. Main problem currently (aside from time) is to define > when a method hides the m

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-23 Thread Ryan Joseph
> On Apr 23, 2018, at 8:22 PM, LacaK wrote: > > Later in uses clause wins ... as for other cases where in different units are > used same names > But probably problem is deeper , what I am not aware of ;-) Swift just gives a compiler error if there is a redefinition of method in the current

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-23 Thread Ryan Joseph
> On Apr 23, 2018, at 7:13 PM, Sven Barth via fpc-pascal > wrote: > > Yes, it is planned. Main problem currently (aside from time) is to define > when a method hides the method of another helper, especially when inheritance > (both for the helper and the extended type) is involved. > Prob

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-23 Thread LacaK
Is planned support for multiple class(objet, record) helpers in a way, that all class helpers can be used in parallel not only one? Yes, it is planned. Main problem currently (aside from time) is to define when a method hides the method of another helper, especially when inher

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-23 Thread Michael Van Canneyt
On Mon, 23 Apr 2018, Marco van de Voort wrote: In our previous episode, Maciej Izak said: full potential of class/record/type helpers is not used :), and by bad choice can be loses for ever. IMO The best direction for type helpers (which can solve all problems) is usage "with" for example:

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-23 Thread Marco van de Voort
In our previous episode, Maciej Izak said: > > full potential of class/record/type helpers is not used :), and by bad > choice can be loses for ever. IMO The best direction for type helpers > (which can solve all problems) is usage "with" for example: > > var > x: TObjectA with THelper1, THelpe

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-23 Thread Maciej Izak
2018-04-23 14:21 GMT+02:00 Mattias Gaertner : > How will this be activated? > A modeswitch? > Will it be default enabled in mode objfpc and disabled in mode delphi? > There was discussion about this while ago... and there was a lot of problems. IMO the best option to solve all problems, is expan

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-23 Thread Mattias Gaertner
On Mon, 23 Apr 2018 12:13:01 + Sven Barth via fpc-pascal wrote: > LacaK schrieb am Mo., 23. Apr. 2018, 13:34: > > > Hi , > > > > I am sure that this was already discussed, but I can not find any > > conclusion. > > > > Is planned support for multiple class(objet, record) helpers in a way, >

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-23 Thread Maciej Izak
2018-04-23 14:02 GMT+02:00 LacaK : > Can you give small example for my use case ? I can not understand from > above mentioned examples. > unit A; type TClassA = class public procedure Method1; end; unit B; type TClassAHelper1 = record private instance: T default; public pr

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-23 Thread Sven Barth via fpc-pascal
LacaK schrieb am Mo., 23. Apr. 2018, 13:34: > Hi , > > I am sure that this was already discussed, but I can not find any > conclusion. > > Is planned support for multiple class(objet, record) helpers in a way, > that all class helpers can be used in parallel not only one? > Yes, it is planned.

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-23 Thread LacaK
Dňa 23.4.2018 o 13:52 Maciej Izak napísal(a): 2018-04-23 13:45 GMT+02:00 Maciej Izak >: https://github.com/maciej-izak/PascalSmartPointers/tree/master/examples small mistake, this is

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-23 Thread Maciej Izak
2018-04-23 13:45 GMT+02:00 Maciej Izak : > https://github.com/maciej-izak/PascalSmartPointers/tree/master/examples > small mistake, this is more proper url :) https://github.com/maciej-izak/PascalSmartPointers/tree/master/sources -- Best regards, Maciej Izak ___

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-23 Thread Maciej Izak
2018-04-23 13:26 GMT+02:00 LacaK : > If such feature will not be implemented, is there any other way how to > solve this problem (how to add functionalities to one class by adding more > units to final program)? > This can be easily solved by "default field" feature. The work is in progress (not

[fpc-pascal] Multiple active class helpers at same time

2018-04-23 Thread LacaK
Hi , I am sure that this was already discussed, but I can not find any conclusion. Is planned support for multiple class(objet, record) helpers in a way, that all class helpers can be used in parallel not only one? My use case is: In unit A I have declared base class. In unit B I have dec