Re: [fpc-pascal] Interfaces via implements keyword

2009-11-28 Thread Denis Golovan
Hi Andrew On Thu, Nov 26, 2009 at 4:48 AM, Andrew Hall wrote: > 1) Always reference your host class through an interface you know will be > implemented by the host class, therefore calling "as" from this interface > will always find any of the interfaces your class may support. The easiest > wo

Re: [fpc-pascal] Interfaces via implements keyword

2009-11-25 Thread Andrew Hall
As you probably guess, the issue for the last line " I2:=I1 as IIntf2;" is that I1 is implemented by "O: TClass1" which no longer supports"IIntf2" - hence the error "interface not supported". It would be nice if the class could know it is part of an "implements" structure and defer to the "paren

Re: [fpc-pascal] Interfaces via implements keyword

2009-11-25 Thread Denis Golovan
Thanks for info. Well. Now I see the technical reason for it. I thought so too. Sure, I'm not a guru in compiler construction, but I'd like to know. Is this a logic by design that I easily get into a situation when querying interfaces is not "transitive". I mean, having one of class interfaces I

Re: [fpc-pascal] Interfaces via implements keyword

2009-11-24 Thread Andrew Hall
This code is working correctly/logically - and the same as it does in Delphi... When using "implements" you are directing that this property "Intf" provides the interface "IIntf1" for your host object "TClass2" - and in TClass2.Create you create object "O: TClass1" to implement interface "IIntf1

Re: [fpc-pascal] Interfaces via implements keyword

2009-11-23 Thread Denis Golovan
Well. Not good obviously. Maybe somebody knows some workarounds? On Mon, Nov 23, 2009 at 11:00 AM, Graeme Geldenhuys < gra...@mastermaths.co.za> wrote: > Michael Van Canneyt wrote: > > > > Not 'might', it definitely is buggy :( > > > +1 > > > > > Regards, > - Graeme - > > -- > fpGUI Toolkit - a

Re: [fpc-pascal] Interfaces via implements keyword

2009-11-23 Thread Graeme Geldenhuys
Michael Van Canneyt wrote: > > Not 'might', it definitely is buggy :( +1 Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/ ___ fpc-pascal maillist - fpc-pascal@lists.freep

Re: [fpc-pascal] Interfaces via implements keyword

2009-11-23 Thread Michael Van Canneyt
On Mon, 23 Nov 2009, Florian Klaempfl wrote: Denis Golovan schrieb: Hi all I've got a non-obvious class hierarchy with interfaces involved. The problem is that, I thought "property ... implements ...;" construction fully substitute for implementing interface methods in class itself, but now

Re: [fpc-pascal] Interfaces via implements keyword

2009-11-23 Thread Florian Klaempfl
Denis Golovan schrieb: > Hi all > > I've got a non-obvious class hierarchy with interfaces involved. > The problem is that, I thought "property ... implements ...;" > construction fully substitute for implementing interface methods in > class itself, but now it's just not true. > I get different r

[fpc-pascal] Interfaces via implements keyword

2009-11-22 Thread Denis Golovan
Hi all I've got a non-obvious class hierarchy with interfaces involved. The problem is that, I thought "property ... implements ...;" construction fully substitute for implementing interface methods in class itself, but now it's just not true. I get different results in case implements is used and