OOP_(re)

Fri, 30 May 1997 01:29:55 -0400 (EDT)


On Thu, 29 May 1997, Peter Gerwinski wrote:

> > Ok, then make it a program level switch, that doesn't have any effect in
> > units... But then, do we need it?
> 
> I suggest to forget about the switch and just store a pointer to a string
> constant holding the name of the object in the VMT.  Since we don't need
> to care about a 64k data segment (4GB will be enough for a while), these
> few extra bytes are harmless.

Yes, but like Frank said, I don't think people making commercial programs
without sources would appreciate having their identifiers in the binary...
Anyway, I think we should drop this idea, unless somebody comes up with a
good idea for a use of this feature... ;-)

> > Its the explicit part I'm trying to avoid... I guess this part will be
> > compiler dependent, but should be among very few (with the TObject.Init
> > constructor).
> 
> Whatever we do here, it will be compiler dependent.  If we implement some
> feature into GPC to select a constructor through a VmtLink, we can be sure
> that no other compiler has this.

Yes, I understand that we can code specifically for GPC, but what I mean
is that if the implicit parameters changes (since they are compiler
implementation dependent), we won't be able to recompile the library with
the newer GPC (with possibly different implicit parameters). I'd rather
see an GPC-specific command to spawn an object using a specific VMT link,
doing the constructor invocation, so that if the constructor invocation
changes, it you could recompile the library without any problem...

> I do not worry about compiler dependence since all of this is written
> especially for GPC - and other compilers which claim to be compatible to
> GPC do not exist yet.  I *do* worry about portability between the various
> platforms GPC runs on.

Of course!

> > > PtrToMyObj^.TypeOf:= TypeOf ( SomeObjectType );
> > 
> > Maybe this would be better... But I don't like this very much either...
> 
> What about
> 
>     AssignType ( MyObj, MyVmtLink );
> 
> where MyObj is an object variable (usually a pointer dereference) and
> MyVmtLink points to the VMT?

Sold. This one I like! :-)

> So am I.  That's one beauty of C:  Everything, including `printf' and such,
> is user-definable.  (Said by someone who is hacking a Pascal compiler because
> he cannot stand the ugly syntax of C/C++ ... ;-)

Yes, it's one of the very few beauties of C... Note that Frank Heckenbach
has a differing opinion on this, which is also quite valid...

Pierre Phaneuf

"The use of COBOL cripples the mind; its teaching should, therefore, be
regarded as a criminal offense." - Edsger W. Dijkstra.



Pierre Phaneuf (pp@dilu.ml.org)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es