[fpc-pascal] stuck with untyped pointer

Alberto Narduzzi albertonarduzzi at yahoo.com
Sat May 29 00:34:38 CEST 2010


> TObject is the base class, it inherits from nobody. To make the whole
> weel run a base class must exists which provide basic functionality
> like Create/Destroy and other methods/events like "ClassName",
> "InheritsFrom"; so if no class is specified it automatically inherits
> from TObject.

I see, and I suspected it was for these reasons, but allow me to say 
this is some sort of helper functions one might not need.
"InhritsFrom", just like Delphi's "Is" (don't know if FPC has the same 
keyword, anyway) are things that can be dealt with the RTTI...

> Pure class in the same idea does not exists in Pascal as in C, or at
> least they do not exists a few time ago.

classes in C are just mere structures, with no inheritance capability 
(i.e no VMT, AFAIK). I'm talking about C99, not C with classes 
and-or-the-like-extensions to the language.
In C++ no base class exists. I can define a "class TMyClass" descending 
from nothing, and have nothing else than it, as my _base_ class.
Not talking about "visual" C/C++ compliers here (which can indeed hide 
something to ease the RTTI engine help the programmer, somehow), just 
pure GCC.
If I am wrong, please correct me, as this is what I have always had the 
idea it worked (and _should_ work, FWIW...)

Cheers, A.

P.S.
I'll probably read/reply tomorrow (ok, later today, GMT + 3...), as now 
I'm tired and wishing to go to bed ;-)



More information about the fpc-pascal mailing list