Eigenpoll : D wish list : Meta Information
Adding meta information to classes, structures, methods, modules and so forth using the pragma statement.
Example of a Reflection API class:
module pqr.xyz;
interface IFoo {
char[] hello(in char[] name);
}
class Foo {
char[] hello(in char[] name) {
return "Hello, " ~ name ~ "!";
}
}
pragma(Reflection, IFoo); // exposing IFoo as being able to be reflected
So it can for example be used in SOAP/CORBA/RMI/COM like manner:
int main(char[][] args) {
SoapRegistry soap = new SoapRegistry();
soap.add(Reflection.fetch("pqr.xyz", "Foo"));
soap.run(80);
return 0;
}
Report this item for cleanup