[fpc-pascal] Advanced Records - Why not available by default?

Sven Barth pascaldragon at googlemail.com
Sun Jan 15 15:47:40 CET 2012


Am 15.01.2012 00:59 schrieb "Lars" <noreply at z505.com>:
>
> Daniel Gaspary wrote:
> > Any special reason to Advanced Records be available only in Delphi Mode
?
>
>
> Personally, I'm getting sick of all the new features added to delphi that
> don't add anything meaningful, and just add complexity to the compiler.
> why didn't borland just make people use old borland objects with methods
> instead of new advanced records? Old borland objects are advanced
> records..

Although I don't know why Borland did it that way (and I'm also not that a
big fan of that extension (but I use them)), I can assure you that advanced
records and objects are not the same:
* objects support inheritance and destructors
* advanced records support the declaration of operators inside them
(important for genetics) and variant parts

> Ticking me off more: why do we even have objects and classes? what is an
> object? what are classes?  I would have preferred if borland would have
> just called old borland objects "Extended records" from day one. Now we
> have this feature overload in the language and it's becoming more and more
> complex of a language (needlessly). Objects, Classes, records.. aren't
> they all the same thing? I don't even personally buy the idea that objects
> even exist.. i think they are just extended records. What is an object? an
> instance of a class? if so, why did borland call the type definition
> "object" if it was supposed to be a class? Ugh. Ugly language - it is
> becoming - sorry to say!
>

Objects were introduced in Turbo Pascal. There were no classes yet, only
objects. When they introduced classes they realized that the object concept
wasn't powerful enough, but because of backwards compatibility they decided
not to "fix" the objects (or adding a compilerswitch for changing the
functionality) but to introduce a new language construct.
The advanced records were AFAIK introduced, because they added them for
Delphi.Net and they wanted to unify the two platforms a bit.

And yes, the word "object" now has two meanings in case of Pascal:
* the old OOP concept
* an instance of a type of the new concept

I also can assure you that at least in the FPC compiler (advanced) records
and objects are not the same.

A little sidenote at the end: in mode MacPascal types declared as "object"
are handled like "class", because the objects in MacPascal are closer to
Delphi's classes than to TP's objects.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20120115/e32350b0/attachment.html>


More information about the fpc-pascal mailing list