[fpc-pascal] All methods vitrual ?

Sven Barth pascaldragon at googlemail.com
Sat Oct 14 14:44:50 CEST 2023


Adriaan van Os via fpc-pascal <fpc-pascal at lists.freepascal.org> schrieb am
Fr., 13. Okt. 2023, 11:02:

> Michael Van Canneyt via fpc-pascal wrote:
> >
> >
> > On Wed, 11 Oct 2023, Adriaan van Os via fpc-pascal wrote:
> >
> >> Michael Van Canneyt via fpc-pascal wrote:
> >>
> >>> $M controls the inclusion of RTTI, i.e. it allows or disallows the
> >>> use of the published section.
> >>> No more, no less.
> >>
> >> I don't see any use in allowing or disallowing something. And with the
> >> current design, it is, as I said, impossible, without macros, to
> >> compile the same code with {$M+} and {$M-}.
> >
> > While I agree with your statement about allowing/disallowing use of
> > 'published' based on a directive, we inherited this from Delphi and it
> > is a very basic part of the language & RTL, so changing it is simply not
> > an option.
>
> Well, as I said, adding a new visibility specifier, e.g. "visible",
> meaning "public" in {$M-} state
> and "published" in {$M=}", does in no way degrade compatibility with
> Delphi code. One could reserve
> the new visibility specifier for modes objfpc and macpas.
>

There will be no new visibility specifiers for something like this.

And yes, it affects compatibility, as that means that code using that
feature couldn't be compiled with Delphi and especially for library
developers that might be an important point.

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20231014/e3e95abd/attachment.htm>


More information about the fpc-pascal mailing list