Mixin C

zjh fqbqrr at 163.com
Fri Mar 8 06:40:35 UTC 2024


On Friday, 8 March 2024 at 03:23:12 UTC, Paul Backus wrote:
> What if instead of importing C files like D modules, we could 
> write bits of C code directly in the middle of our D code, like 
> we do with inline ASM?
>


Why not create a separate file `name extension`, such as 
`'dc'`,then like this:

```d
//aa.dc
#include <stdio.h>
printf("Hello from C!\n");

//b.d
import aa;
```



More information about the dip.ideas mailing list