mixin Instantiate!(foo,int);
Thanks for the syntax tip!
You could use cp instead of dmd -H.
That won't produce the same output (eg large functions tend to be
stripped currently), but I guess the current behavior is
relatively useless so it's fine.
want you are after. Such a thing could actually be done except
for OMF/Optlink. Since OMF doesn't support custom sections
there is a no special place to store the code that the compiler
could easily access.
If we want to embed the AST inside an "import" library file
(which is optional, could be done with a directory), wouldn't it
be possible to store the AST as a global / static variable? When
dmd compiles myfun.d, it generates the AST and inserts a global
variable (eg void*_ast_myfun=...) in the data segment of the
library/object file (that could be done with a mixin and be
portable).
just started a new thread for related ideas:
http://forum.dlang.org/thread/lmepufogzaxlbxwgu...@forum.dlang.org
thanks!