ImportC has improved macro support

Walter Bright newshound2 at digitalmars.com
Wed Dec 6 20:26:38 UTC 2023


On 12/6/2023 11:59 AM, Walter Bright wrote:
> Macros with the pattern:
> 
>      #define BOO ( expression )
> 
> are now translated to:
> 
>      auto BOO()() { return expression; }
> 
> and are available for importing!

The interesting thing here is `expression` does not need to be translated to D. 
It's still a C expression, and has C semantics. D templates with C semantics 
just falls out of the way ImportC was implemented.


More information about the Digitalmars-d-announce mailing list