[fpc-pascal] Syntax changes suggestions

Sven Barth pascaldragon at googlemail.com
Wed Jul 18 20:47:45 CEST 2018


Ryan Joseph <ryan at thealchemistguild.com> schrieb am Mi., 18. Juli 2018,
19:00:

>
>
> > On Jul 18, 2018, at 7:14 AM, Ben Grasset <operator97 at gmail.com> wrote:
> >
> > Classes are unsuitable performance-wise for many use cases, and TP
> objects lack important features such as variant parts. Advanced records are
> a great lightweight in-between point.
>
> Yes indeed. Not being able to allocate classes on the stack is a scandal
> for Pascal. I don’t know why the devs decided classes must be on the heap
> and anything other than that would violate some supposed design principle
> (Delphi??).
>

A point against stack based classes is that Object Pascal's object model is
highly geared towards polymorphism (with things like virtual class methods
and constructors that C++ does not support). You can't make use of this
however if the class is instantiated on the stack.

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20180718/cdcc700c/attachment.html>


More information about the fpc-pascal mailing list