Thread overview
For the ImportC feature, one must use the keyword "importC" instead of "import"
Mar 24
Илья
Mar 30
IchorDev
Apr 02
Hipreme
March 24

"import" imports both .c files and .d files while they can be named the same.This is a problem.
In addition, during the import .c files compiler acts a little differently. Why not make the different behaviors explicit?

March 30

On Sunday, 24 March 2024 at 08:48:43 UTC, Илья wrote:

>

"import" imports both .c files and .d files while they can be named the same.This is a problem.
In addition, during the import .c files compiler acts a little differently.

I think import(C) would be a good syntax, because we already have this syntax for extern. As to the importance of this feature, it's hard for me to say.

April 02

On Saturday, 30 March 2024 at 14:28:23 UTC, IchorDev wrote:

>

On Sunday, 24 March 2024 at 08:48:43 UTC, Илья wrote:

>

"import" imports both .c files and .d files while they can be named the same.This is a problem.
In addition, during the import .c files compiler acts a little differently.

I think import(C) would be a good syntax, because we already have this syntax for extern. As to the importance of this feature, it's hard for me to say.

The syntax with parenthesis is used for loading any kind of file with string import paths.
That being said, I don't think it is possible to do that on the compiler side. But I do agree that importing C files the same way as D it is quite bizarre.

I know that they used to have a syntax validation for #include. Maybe they could use it for something like #import, just like Objective-C does.

April 03
On 4/2/2024 10:17 AM, Hipreme wrote:
> But I do agree that importing C files the same way as D it is quite bizarre.

The purpose of the design is so that the importer need not know how the module is implemented.