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++)`.
  • DLF September... Mike Parker via Digitalmars-d-announce
    • Re: DLF ... max haughton via Digitalmars-d-announce
    • Re: DLF ... Paul Backus via Digitalmars-d-announce
      • Re: ... RazvanN via Digitalmars-d-announce
        • ... Paul Backus via Digitalmars-d-announce
      • Re: ... Tim via Digitalmars-d-announce
        • ... Paul Backus via Digitalmars-d-announce
          • ... RazvanN via Digitalmars-d-announce
    • Re: DLF ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-announce
      • Re: ... FeepingCreature via Digitalmars-d-announce
        • ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-announce
    • Re: DLF ... zjh via Digitalmars-d-announce
      • Re: ... Imperatorn via Digitalmars-d-announce
        • ... zjh via Digitalmars-d-announce
      • Re: ... Mike Parker via Digitalmars-d-announce
        • ... matheus via Digitalmars-d-announce

Reply via email to