DLF September 2023 Monthly Meeting Summary
Tim
tim.dlang at t-online.de
Mon Nov 13 16:23:05 UTC 2023
On Sunday, 12 November 2023 at 21:55:31 UTC, Paul Backus wrote:
> Personally, my number-one complaint with dmd-as-a-library is
> that I am forced to use `extern(C++)` when creating my own
> `Visitor` classes.
>
> In [`dmdtags`][1], this requirement has made it necessary for
> me to implement my own C++-compatible [`Span`][2] and
> [`Appender`][3] types, just to avoid the C++ mangling errors
> caused by D's built-in `T[]` slices.
>
> I have no use for overriding AST nodes, but the ability to use
> `extern(D)` visitors with dmd-as-a-library would be a welcome
> improvement.
The visitor can already be `extern(D)`. Only member functions
overriding those in the base class need to be `extern(C++)`.
Other member functions can then use paratemers, which would be
incompatible with `extern(C++)`.
More information about the Digitalmars-d-announce
mailing list