digitalmars.dip.ideas - For the ImportC feature, one must use the keyword "importC" instead of
- =?UTF-8?B?0JjQu9GM0Y8=?= (4/4) Mar 24 "import" imports both .c files and .d files while they can be
- IchorDev (4/8) Mar 30 I think `import(C)` would be a good syntax, because we already
- Hipreme (9/17) Apr 02 The syntax with parenthesis is used for loading any kind of file
- Walter Bright (3/4) Apr 03 The purpose of the design is so that the importer need not know how the ...
"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?
Mar 24
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.
Mar 30
On Saturday, 30 March 2024 at 14:28:23 UTC, IchorDev wrote:On Sunday, 24 March 2024 at 08:48:43 UTC, Илья wrote: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."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.
Apr 02
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.
Apr 03