Compile time function execution...

Walter Bright newshound at digitalmars.com
Thu Feb 15 13:02:40 PST 2007


Gregor Richards wrote:
> I see that I can't do this:
> 
> char[] someCompileTimeFunction()
> {
>     return "writefln(\"Wowza!\");";
> }
> 
> int main()
> {
>     mixin(someCompileTimeFunction());
>     return 0;
> }
> 
> 
> Any chance of compile-time code generation via this mechanism? Or are 
> they simply handled in different, incompatible steps of compilation?
> 
>  - Gregor Richards
> 
> PS: Yes, I realize this is a terrible idea ^^

That's a bug. I'll fix it.



More information about the Digitalmars-d mailing list