mixins

Ellery Newcomer ellery-newcomer at utulsa.edu
Thu Jul 9 18:37:52 PDT 2009


>From the specs:
It is not an error to have const module variable declarations without
initializers if there is no constructor. This is to support the practice
of having modules serve only as declarations that are not linked in, the
implementation of it will be in another module that is linked in.

How would one actually do this?

Also,

this don't compile:

mixin(gurk());
char[] gurk(){
  return "pragma(msg,`hello`);";
}

but this does:

char[] gurk(){
  return "pragma(msg,`hello`);";
}
mixin(gurk());

are mixins evaluated in the same pass that builds the symbol table?


More information about the Digitalmars-d-learn mailing list