Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-27 Thread Ryan Joseph via fpc-pascal
> On Dec 27, 2019, at 1:39 PM, Adriaan van Os wrote: > > etcetera. The disadvantage of this approach is that for example a default > DoKeyCommand must be written three times, for TApplication, TDocument and > TView, where the code for TDocument.DoKeyCommand and TView.DoKeyCommand is >

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-27 Thread Adriaan van Os
Ryan Joseph via fpc-pascal wrote: Adriaan, what was your idea you had in mind when you brought this up? Well, to give you an idea, here is an example (somewhat simplified for clarity). I am currently porting MacApp to 64-bit. MacApp currently has TView = class( TEventHandler)

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-27 Thread Ryan Joseph via fpc-pascal
> On Dec 27, 2019, at 10:29 AM, Ryan Joseph wrote: > > It's really just about the namespace and avoiding deeply nested this.that.do > kind of syntax. We could accomplish this using just plain records, no need to > even get involved with the complicated interface syntax. According to the >

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-27 Thread Ryan Joseph via fpc-pascal
> On Dec 27, 2019, at 10:01 AM, Sven Barth via fpc-pascal > wrote: > > To be clear: with declaration time I mean when the type is written (" = class > ... end") versus creation time (either "var x: tmyclass" or "x := tmyclass > .create"). The difference would be that the user of the class

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-27 Thread Sven Barth via fpc-pascal
Am 26.12.2019 um 20:32 schrieb Ryan Joseph via fpc-pascal: On Dec 24, 2019, at 1:16 AM, Sven Barth via fpc-pascal wrote: Basically, yes, though of course syntax, implementation and behavior need to be nicely defined first. For example there is the difference whether something is added at

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-27 Thread Ryan Joseph via fpc-pascal
> On Dec 27, 2019, at 8:21 AM, Adriaan van Os wrote: > > The code of a "mixin" or "trait" or "delegate" (or whatever > implementing-something) can be referenced and it can put virtually into the > namespace of an object. The one thing you cannot do however, is copy the > code, because then

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-27 Thread Adriaan van Os
Ryan Joseph via fpc-pascal wrote: - Importing fields/properties is easy because we can just add symbols to the symbol table but I'm not sure what it means in terms of the compiler to import a method from another class. The method needs to be cloned or perhaps synthesized as I've seen the

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-26 Thread Ryan Joseph via fpc-pascal
> On Dec 24, 2019, at 1:16 AM, Sven Barth via fpc-pascal > wrote: > > Basically, yes, though of course syntax, implementation and behavior need to > be nicely defined first. For example there is the difference whether > something is added at declaration time of the class or the creation

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-24 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Di., 24. Dez. 2019, 02:47: > > > > On Dec 23, 2019, at 7:57 PM, Ryan Joseph wrote: > > > > I never heard of "mixin" before but I'll study the wiki. > > > > I assume that the compiler team has decided multiple inheritance is a > bad idea correct? Personally

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-23 Thread Ryan Joseph via fpc-pascal
> On Dec 23, 2019, at 7:57 PM, Ryan Joseph wrote: > > I never heard of "mixin" before but I'll study the wiki. > > I assume that the compiler team has decided multiple inheritance is a bad > idea correct? Personally I don't have enough experience to know but I see > there is a need to

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-23 Thread Ryan Joseph via fpc-pascal
> On Dec 23, 2019, at 2:02 AM, Sven Barth via fpc-pascal > wrote: > > What might be more interesting in this context than multiple inheritance is > the concept of aspects (aka aspect oriented programming though you might also > want to look for "mixin"; there's an old thread about that: >

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-22 Thread Sven Barth via fpc-pascal
Adriaan van Os schrieb am So., 22. Dez. 2019, 20:53: > I have always wondered why hierarchies in object-oriented programming are > idolized, where in the > database world hierarchical databases are something of the past and > everything is relational there > now

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-22 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal > > > On Dec 22, 2019, at 5:26 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > You don't seem to understand what implementing an interface means in > Object Pascal. It means that a class can be cast to an interface. It does > *not* mean

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-22 Thread Adriaan van Os
Ryan Joseph via fpc-pascal wrote: I guess I'm not seeing the design pattern which they was invented for and I've never come across it in my own work. Not against the idea in any way however. My mind went in the same direction as Adriaan's did when I saw "implements" I thought that one class

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-22 Thread Ryan Joseph via fpc-pascal
> On Dec 22, 2019, at 5:26 AM, Sven Barth via fpc-pascal > wrote: > > You don't seem to understand what implementing an interface means in Object > Pascal. It means that a class can be cast to an interface. It does *not* mean > that the interface's methods are available from that class. I

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-22 Thread Sven Barth via fpc-pascal
Am 22.12.2019 um 04:44 schrieb Ryan Joseph via fpc-pascal: On Dec 21, 2019, at 10:49 AM, Adriaan van Os wrote: I had hoped that procedure IMyInterface2.P2 would now be visible as a method of TMyClass. This would be quite helpful in implementing multiple-inheritance. But no, the implements

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-21 Thread Ryan Joseph via fpc-pascal
> On Dec 21, 2019, at 10:49 AM, Adriaan van Os wrote: > > I had hoped that procedure IMyInterface2.P2 would now be visible as a method > of TMyClass. This would be quite helpful in implementing > multiple-inheritance. But no, the implements specifier completely hides it. I > assume this has

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-21 Thread Sven Barth via fpc-pascal
Am 21.12.2019 um 16:49 schrieb Adriaan van Os: Section 7.4 Interface delegation of the FPC Language Reference Guide discusses interface delegates and the implements property specifier. For example $interfaces

[fpc-pascal] Interface delegates and the implements property specifier

2019-12-21 Thread Adriaan van Os
Section 7.4 Interface delegation of the FPC Language Reference Guide discusses interface delegates and the implements property specifier. For example $interfaces corba} type IMyInterface = interface procedure