Re: [fpc-pascal] Question about interfaces and patch

2005-03-26 Thread ml
Quoting Thomas Schatzl <[EMAIL PROTECTED]>: > Hello, > > note in advance: if I mention CORBA interfaces, I actually mean "CORBA > style" or Java/.net like interfaces (which are not real CORBA interfaces > anyway) in the following (too lazy to do a search&replace or find > another term). > > [E

Re: [fpc-pascal] Question about interfaces and patch

2005-03-26 Thread Thomas Schatzl
Hello, note in advance: if I mention CORBA interfaces, I actually mean "CORBA style" or Java/.net like interfaces (which are not real CORBA interfaces anyway) in the following (too lazy to do a search&replace or find another term). [EMAIL PROTECTED] schrieb: ml schrieb: Hmmm, Delphi gives a compil

Re: [fpc-pascal] Question about interfaces and patch

2005-03-25 Thread ml
Quoting Thomas Schatzl <[EMAIL PROTECTED]>: > Hello, > > ml schrieb: > Hmmm, Delphi gives a compile time error if "as" is used on an interface > without GUID, same for support()... since both use the interfaces IID to > query for existence of an interface (either directly or via > QueryInterf

Re: [fpc-pascal] Question about interfaces and patch

2005-03-25 Thread Thomas Schatzl
Hello, ml schrieb: I made one wrong statement. It's not "as" that doesn't work. getinterfaceentry works only for interfaces that have guid specified. By default guid is zeroed, and getinterfaceentry just returns first interface in table, which means wrong. Same problem shows in Support too. Hmmm, D

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread ml
I made one wrong statement. It's not "as" that doesn't work. getinterfaceentry works only for interfaces that have guid specified. By default guid is zeroed, and getinterfaceentry just returns first interface in table, which means wrong. Same problem shows in Support too. writing guid like ['{000

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread Marcel Martin
Michael Van Canneyt wrote: On Thu, 24 Mar 2005 [EMAIL PROTECTED] wrote: procedure MyXYZPart.DoReport(aRep: IReportable); begin if (aRep <> nil) then begin if (aRep is ILogged) then (aRep as ILogged).Log(aRep.Report) else aRep.Report end; I see what you want, but if you would do pr

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread memsom
> 1. and what I would like is just a lot cleaner and readable code of > this. > 2. Before you tell how to do something at least test and look your > solution > 2.1. Because queryinterface doesn't work in fpc as it should you always > get first vmt and if you do a queryinterface you don't work with

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread ml
On Thu, 2005-03-24 at 21:21 +0100, Michael Van Canneyt wrote: > OK, now I see where you're going. > > Your last sentence means: I want DoReport to accept only an 'IReportable' > But at the same time, your code is checking that behind 'IReportable' > there is also an 'ILogged'. > > I find this a

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread Michael Van Canneyt
On Thu, 24 Mar 2005, ml wrote: [Cut] > > > > > > procedure MyXYZPart.DoReport(aRep: IReportable); > > > begin > > > if (aRep <> nil) then begin > > >if (aRep is ILogged) then > > > (aRep as ILogged).Log(aRep.Report) > > >else > > > aRep.Report > > > end; > > > > I see what you

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread ml
On Thu, 2005-03-24 at 15:01 +0100, Michael Van Canneyt wrote: > > On Thu, 24 Mar 2005, ml wrote: > > > On Thu, 2005-03-24 at 09:06 +0100, Michael Van Canneyt wrote: > >> > >> On Thu, 24 Mar 2005 [EMAIL PROTECTED] wrote: > >> > >>> Quoting Michael Van Canneyt <[EMAIL PROTECTED]>: > >>> > > >>

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread ml
On Thu, 2005-03-24 at 14:37 +, memsom wrote: > Sorry to be late in the conversation... > > >> Here is a simple example how it should be used > >> > >> type > >> IReportable = interface > >>function Report: string; > >>// let's say that this should write report and > >>// return st

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread memsom
Sorry to be late in the conversation... >> Here is a simple example how it should be used >> >> type >> IReportable = interface >>function Report: string; >>// let's say that this should write report and >>// return status description as string >> end; >> >> ILogged = interface >>

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread Michael Van Canneyt
On Thu, 24 Mar 2005, ml wrote: On Thu, 2005-03-24 at 09:06 +0100, Michael Van Canneyt wrote: On Thu, 24 Mar 2005 [EMAIL PROTECTED] wrote: Quoting Michael Van Canneyt <[EMAIL PROTECTED]>: On Wed, 23 Mar 2005 [EMAIL PROTECTED] wrote: Quoting Marco van de Voort <[EMAIL PROTECTED]>: On Tue, 22 Mar 20

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread ml
On Thu, 2005-03-24 at 09:06 +0100, Michael Van Canneyt wrote: > > On Thu, 24 Mar 2005 [EMAIL PROTECTED] wrote: > > > Quoting Michael Van Canneyt <[EMAIL PROTECTED]>: > > > >> > >> > >> On Wed, 23 Mar 2005 [EMAIL PROTECTED] wrote: > >> > >>> Quoting Marco van de Voort <[EMAIL PROTECTED]>: > >>> >

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread Michael Van Canneyt
On Thu, 24 Mar 2005 [EMAIL PROTECTED] wrote: Quoting Michael Van Canneyt <[EMAIL PROTECTED]>: On Wed, 23 Mar 2005 [EMAIL PROTECTED] wrote: Quoting Marco van de Voort <[EMAIL PROTECTED]>: On Tue, 22 Mar 2005, ml wrote: // than one interface a := (object as IA); // correct b := (object as IB); //

Re: [fpc-pascal] Question about interfaces and patch

2005-03-23 Thread ml
Quoting Michael Van Canneyt <[EMAIL PROTECTED]>: > > > On Wed, 23 Mar 2005 [EMAIL PROTECTED] wrote: > > > Quoting Marco van de Voort <[EMAIL PROTECTED]>: > > > >>> On Tue, 22 Mar 2005, ml wrote: > // than one interface > a := (object as IA); // correct > b := (object as IB); //

Re: [fpc-pascal] Question about interfaces and patch

2005-03-23 Thread Michael Van Canneyt
On Wed, 23 Mar 2005 [EMAIL PROTECTED] wrote: Quoting Marco van de Voort <[EMAIL PROTECTED]>: On Tue, 22 Mar 2005, ml wrote: // than one interface a := (object as IA); // correct b := (object as IB); // returns pointer to the first interface vmt=IA c := (object as IC); // returns pointer to the

Re: [fpc-pascal] Question about interfaces and patch

2005-03-23 Thread ml
Quoting Marco van de Voort <[EMAIL PROTECTED]>: > > On Tue, 22 Mar 2005, ml wrote: > > > // than one interface > > > a := (object as IA); // correct > > > b := (object as IB); // returns pointer to the first interface vmt=IA > > > c := (object as IC); // returns pointer to the first interface v

Re: [fpc-pascal] Question about interfaces

2005-03-23 Thread Marco van de Voort
> On Tue, 22 Mar 2005, ml wrote: > > // than one interface > > a := (object as IA); // correct > > b := (object as IB); // returns pointer to the first interface vmt=IA > > c := (object as IC); // returns pointer to the first interface vmt=IA > > // there's no way to do again it's like direct ca

Re: [fpc-pascal] Question about interfaces

2005-03-23 Thread Michael Van Canneyt
On Tue, 22 Mar 2005, ml wrote: Quoting Marco van de Voort <[EMAIL PROTECTED]>: Like first, I wouldn't like to spam this mailing list about interfaces. Can I contact you directly or somewhere else? I would like to try to patch some things but I would probably have few questions how to implement it

Re: [fpc-pascal] Question about interfaces

2005-03-22 Thread ml
> > Quoting Marco van de Voort <[EMAIL PROTECTED]>: Like first, I wouldn't like to spam this mailing list about interfaces. Can I contact you directly or somewhere else? I would like to try to patch some things but I would probably have few questions how to implement it to satisfy everybody, or

Re: [fpc-pascal] Question about interfaces

2005-03-21 Thread Jonas Maebe
On 21 mrt 2005, at 05:08, Marco van de Voort wrote: Nonsense. Python and perl etc were launched in the bubble era and are still floating on that capital. However there is a lot of hype and tinkering,and little real work done in it. If this kind of silly discussions have to be held, please do so o

Re: [fpc-pascal] Question about interfaces

2005-03-20 Thread Marco van de Voort
> Quoting Marco van de Voort <[EMAIL PROTECTED]>: > > > > > Afaik not, you have a pointer to an interface table, And even if you can get > > to the object vmt from there, you don't know anything about it. interface is > > all about information hiding. It might not even be a proper Pascal object.

Re: [fpc-pascal] Question about interfaces

2005-03-20 Thread Nikolai Zhubr
Hi, Monday, 21 March, 2005, 8:58:07, ml at brainwashers dot org wrote: [...] > Fork? if there would be patches they would be insignificant, but since I'm > inside of tech preview for my project this would mean that fpc would go out of > race for this project before I would started patching > eith

Re: [fpc-pascal] Question about interfaces

2005-03-20 Thread ml
Quoting Marco van de Voort <[EMAIL PROTECTED]>: > > Afaik not, you have a pointer to an interface table, And even if you can get > to the object vmt from there, you don't know anything about it. interface is > all about information hiding. It might not even be a proper Pascal object. > > No, the

Re: [fpc-pascal] Question about interfaces

2005-03-20 Thread Marco van de Voort
> Quoting Marco van de Voort <[EMAIL PROTECTED]>: > > > begin > > x:=getintfromsomewhere; > > writeln(x.someproperty); > > end; > > > > how do I know what code to generate for the property? > > > > > Shouldn't direct access to object and resolving object property be involved > here > w

Re: [fpc-pascal] Question about interfaces

2005-03-20 Thread ml
Quoting Marco van de Voort <[EMAIL PROTECTED]>: > > Seems a bit sad to me that, I didn't get answer to "what I really asked" > > but a lot of flaming posts about one btw. in my question, even subject > > says "Question about interfaces" and not "Question about operators". > > > > 1. Couldn't int

Re: [fpc-pascal] Question about interfaces

2005-03-20 Thread Michael Van Canneyt
On Sun, 20 Mar 2005, Florian Klaempfl wrote: > > This is correct. In true Unix philosphy, I also use the tool I think fits > > the job best. > > This may or may not be Pascal. > > > > But look at it like this: Chess has a set of limited and strict rules > > which are not subject to change. Gran

Re: [fpc-pascal] Question about interfaces

2005-03-20 Thread Florian Klaempfl
Michael Van Canneyt wrote: On Sun, 20 Mar 2005, ml wrote: On Sun, 2005-03-20 at 02:55 +0200, Nikolay Nikolov wrote: ml wrote: Other possibilities like ['?','%','$','|','&','::','^'] were only named under btw. (and how can btw. under question 2 become the main flaming topic is out of my reason, ma

Re: [fpc-pascal] Question about interfaces

2005-03-20 Thread Michael Van Canneyt
On Sun, 20 Mar 2005, ml wrote: > On Sun, 2005-03-20 at 02:55 +0200, Nikolay Nikolov wrote: > > ml wrote: > > > > >Other possibilities like ['?','%','$','|','&','::','^'] were only named > > >under btw. (and how can btw. under question 2 become the main flaming > > >topic is out of my reason, ma

Re: [fpc-pascal] Question about interfaces

2005-03-20 Thread Nikolay Nikolov
ml wrote: But you're wrong for '::' '::' exists in perl too. Sorry, I don't speak perl :) I know only C, C++, Java, C# and Object Pascal. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Question about interfaces

2005-03-20 Thread Marco van de Voort
> Seems a bit sad to me that, I didn't get answer to "what I really asked" > but a lot of flaming posts about one btw. in my question, even subject > says "Question about interfaces" and not "Question about operators". > > 1. Couldn't interfaces support blind properties (specifying only read > wr

Re: [fpc-pascal] Question about interfaces

2005-03-19 Thread ml
On Sun, 2005-03-20 at 02:55 +0200, Nikolay Nikolov wrote: > ml wrote: > > >Other possibilities like ['?','%','$','|','&','::','^'] were only named > >under btw. (and how can btw. under question 2 become the main flaming > >topic is out of my reason, maybe its time to my annual lobotomy) > > > >

Re: [fpc-pascal] Question about interfaces

2005-03-19 Thread Nikolay Nikolov
ml wrote: Other possibilities like ['?','%','$','|','&','::','^'] were only named under btw. (and how can btw. under question 2 become the main flaming topic is out of my reason, maybe its time to my annual lobotomy) Well, mentioning C-isms in a pascal forum may sometimes lead to flames :) (Yes

Re: [fpc-pascal] Question about interfaces

2005-03-19 Thread ml
If you would at least read original message and responded to what I asked or at least "not responded" maybe I wouldn't feel so stupid for asking my question. But hopefully this will be the last message in this thread. Seems a bit sad to me that, I didn't get answer to "what I really asked" but a l

Re: [fpc-pascal] Question about interfaces

2005-03-19 Thread Jonas Raoni Soares Silva
On Sat, 19 Mar 2005 09:26:18 +0100, Jonas Maebe <[EMAIL PROTECTED]> wrote: > Until someone else has to read your code, who attached entirely > different meanings to those symbols in his own code... I agree, pascal is one of the most clean, intuitive and easy to read languages... While updating it,

Re: [fpc-pascal] Question about interfaces

2005-03-19 Thread Bob Shaffer
I think I'm going to have to agree with everyone else on this one. If I read this, thinking it was pascal code, I wouldn't have the slightest idea what these % and/or $ operators were doing. Operator overloading should never be used to change the meaning of an operator. It's there so you can mak

Re: [fpc-pascal] Question about interfaces

2005-03-19 Thread Jonas Maebe
On 19 Mar 2005, at 00:44, ml wrote: btw. and yes,:) my line of work forces me to use pascal, c#, c++, c, sql, shell and a little bit of php. So I'm forced to see the beauty and the ugly parts and features of each one. And operators are a real life saver, at least for future reading of your code (th

Re: [fpc-pascal] Question about interfaces

2005-03-18 Thread Micha Nelissen
On Sat, 19 Mar 2005 00:44:24 +0100 ml <[EMAIL PROTECTED]> wrote: > > These are C++ operators, aren't they? > > Yes (some of them are, but not all), but if you think about it basic > definition of operators is to make source code more easily readable. > > Couldn't you imagine to use > a := b % c

Re: [fpc-pascal] Question about interfaces

2005-03-18 Thread ml
On Sat, 2005-03-19 at 03:55 +0200, Nikolay Nikolov wrote: > ml wrote: > > >3. This one is not some little beauty hack. So, no pressure here. But, I > >must admit that I'm most interested in this answer. Classes do support > >multiple interface inheritance, but interfaces don't. That cuts almost >

Re: [fpc-pascal] Question about interfaces

2005-03-18 Thread Nikolay Nikolov
ml wrote: 3. This one is not some little beauty hack. So, no pressure here. But, I must admit that I'm most interested in this answer. Classes do support multiple interface inheritance, but interfaces don't. That cuts almost all of the interface flexibility. Any good reasons why? Probably becaus

Re: [fpc-pascal] Question about interfaces

2005-03-18 Thread ml
On Sat, 2005-03-19 at 01:40 +0200, Nikolay Nikolov wrote: > ml wrote: > > >btw. When writing about operators, why do they contain such little > >possibilities. operator overloads could contain possibility for > >['?','%','$','|','&','::','^'] > > > > > These are C++ operators, aren't they? Yes

Re: [fpc-pascal] Question about interfaces

2005-03-18 Thread Nikolay Nikolov
ml wrote: btw. When writing about operators, why do they contain such little possibilities. operator overloads could contain possibility for ['?','%','$','|','&','::','^'] These are C++ operators, aren't they? ___ fpc-pascal maillist - fpc-pascal@lis

[fpc-pascal] Question about interfaces

2005-03-18 Thread ml
Just a curiosity. 1. Why does one have t specify: type IMyInterface = interface function GetMyProp: integer; procedure SetMyProp(val: integer); property MyProp: integer read GetMyProp write SetMyProp; end; As soon as you specify property in interface that costs source 1 or 2 lines