ImportC can now automatically run the preprocessor

max haughton maxhaton at gmail.com
Mon May 16 05:16:10 UTC 2022


On Monday, 16 May 2022 at 05:08:58 UTC, Walter Bright wrote:
> Interesting. I note that this is inserting C expressions and 
> statements into D functions. ImportC works at the declaration 
> level - i.e. inserting C symbols. I expect there may be 
> impedance mismatch problems by putting it at a lower level. In 
> fact I'm certain that a redo of how the C semantics are handled 
> in the compiler would be necessary.

The PoC for mixinC (the syntax is actually mixin[C] because it 
was easier to parse) that I did doesn't blow up (note: this does 
not mean it works) many things I tried.

As long as the semantic analysis can happen in a new Scope (a dmd 
one not a lexical one) then the normal semantic routines should 
work and it'll be the same as any other mixin (I.e. mixin is not 
free of bugs).


More information about the Digitalmars-d mailing list