[fpc-pascal] Question about interfaces

ml at brainwashers.org ml at brainwashers.org
Mon Mar 21 06:58:07 CET 2005


Quoting Marco van de Voort <marcov at stack.nl>:

> 
> 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 whole idea of property is simply to easily declare iDE editable
> values. As nice added extra: the ability to change from direct field to
> getter/setter based access easily. (read: without changes in the calling
> code)
> 

Could you explain this extra a little more?
Hope its not connected to lazarus. I don't use it. If it is then I don't need
explanation.  

> 
> Yes, that's what that is? And of course a feature is not auto included up
> front, and all sides have to be carefully weighted. Moreover, in a compiled
> language, there is much less possible.
>  

Agreed.

> 
> 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. Of course, enough hype will ensure that some
> stuff will be done, but I don't really have the feeling that the hype and
> actual serious use are in any sane proportion.
> 

Little work? Guess we live in different world

> 
> A 0
> --- in IA only this is visible
> B 4
> -- in IB only this is visible
> C 8
> 
> Now go to the MI example,  assume that C inherits from both IA and IB, and
> IB not from iA
> 
> IA:
> A 0
> 
> IB:
> B 0  
> 
> IC: ?

Couldn't this be solved with offset?
IC > IA=0,IB=+IA

and how does the object do that?

TC=class(IA,IB,IC)

or if I understand it correctly object has this solved in vmt, and interface
posseses no internal vmt

> 
> Still no idea what so ever. What can you do ?
> 

Nevermind, didn't expect that anyway

> 
> Do that everyday, never missed foreach.
> 

you != me != people;
Nevermind();

> 
> So in short you say you use iterators on one spot. Mmany languages
> have iterator systems, but most don't have the silly syntactic sugar
> foreach.
> 
> So in your case it is only short for
> 
> x:=startiter;
> while x,iterateover do y;
> 

yes. did you expect anything else? most best solutions are simple

> 
> So again it is actually only a shorthand notation for something that
> can be done perfectly otherwise. (Write them out, and test all interfaces)
> 
> One can think up a terse short notation for _every_ construct there is, that
> _somebody_ uses a lot, but it will only blow up language and runtime, and
> eat
> up developer time.
> 
> To give you an counter example: Personally the only thing currently on my
> wishlist are generics. But that is a bit too hefty to implement shortterm.
> 
> Why generics? They really allow things that can't be done:
> - typesafe containers.
> - parameterising algoratims with types in general.
> 

generics in pascal?
you lost me there. Generics are nothing but typesafe declarations, used in
higher languages like c# and java.. In c# every variable, record or class is
descedant of object. And generics are nothing but speedup for  untyped access 
aka. boxing/unboxing  of variables
where boxing is nothing else but
object a = string s;
But since this one comes with performance cost generics were declared
in c# 
class <int> List

pascal does not suffer from  box/unbox timing
in fact pascal does not support box/unbox

But probably you know what you talk about, I'm not going to bother for explanation

> 
> It is also significantly more heavy weight. That is not necessarily bad, it
> is just what you choose for. Delphi has enough room to implement frameworks
> on top of it. And not only for this solution. Moreover one can take over
> the designer via the toolsapi without access to delphi.
>  

I was pointing out how bad default windows interface is

> 
> It will be interesting to see your patches then. Maybe I'll change my
> opinion
> if I have played with your fork of the code.
> 

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 
either solution  is simple and supported directly or not 

> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> 




----------------------------------------------------------------------
This mail sent through Horde-Toaster (http://qmailtoaster.clikka.com/)




More information about the fpc-pascal mailing list