Delphi classes (Was: bugs, incompatibity, function attributes)

Thu, 3 Jul 1997 14:46:41 +0200 (MET DST)


According to Frank Heckenbach:
> 
> Besides, removing "asmname" would break some existing programs (including
> a published one of mine)...

Okay, I will let it in.

> So "class" = "pointer to object", approximately...

It's "class" = "reference to object".  Fortunately, the GCC front-end
is able to deal with such things, so we "only" have to implement the
syntax into GPC - and take care that it doesn't break other applications
of reference types such as `Var' parameters and procedural variables.

> [Constructors and destructors ...]

We should try to be compatible to Delphi and the ANSI Object Pascal draft.

> This reminds me of C++'s "reference types" (not only for objects, but for
> any types). I.e., a pointer internally, but dereferenced automatically when
> necessary. I think they could be quite useful sometimes, anyway, and if
> they'll be implemented (syntax?), we'd have "class" = "reference to
> object"...

General-purpose reference types?  :-/  That's C++'s workaround for the
missing `Var' parameters.  I think this would cause more confusion than
goods.

> [public, published, private, protected, ...]  So, perhaps
> we could allow all those keywords, including "published", in any order, also
> possibly repeated (unlike BP).

I agree.

> > 6. All classes to have the same ultimate ancestor object.
> 
> The same discussion as with objects recently... ;-)
> Is this really necessary (if so, for what?), or is it sufficient if all
> classes in a given library use the same ancestor by convention?

I don't like this at all.  This is very useful as a convention when
writing a library, but it is not the job of the compiler.  Since Delphi
seems to do it this way, GPC should behave the same in `--delphi' mode,
but not by default.

Greetings,

    Peter

 Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer
peter.gerwinski@uni-essen.de - http://home.pages.de/~peter.gerwinski/ [970201]
 maintainer GNU Pascal [970624] - http://home.pages.de/~gnu-pascal/ [970125]


Peter Gerwinski (peter@agnes.dida.physik.uni-essen.de)

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