Regarding: import "foo.h";

Kapps opantm2+spam at gmail.com
Thu Jul 18 08:04:15 PDT 2013


On Wednesday, 17 July 2013 at 22:52:40 UTC, Walter Bright wrote:
> Over the years, I've given a fair amount of thought to, and 
> talked about it with various people:
>
>    import "foo.h";
>

Personally I'd rather see something like this as part of a more 
generic feature rather than built in to the compiler. If CTFE 
could call external libraries or programs, such as utilizing 
libclang for parsing (and ideally if it could perform caching of 
[pure?] mixins that took more than X to evaluate), it would be 
nicer than including a C parser inside a D compiler. Then it's 
the responsibility of the project / package manager to make sure 
that the dependency is present and also avoids certain licensing 
/ maintainability issues. Not sure how feasible having CTFE be 
able to call external libraries is though, or if it would be 
desired.


More information about the Digitalmars-d mailing list