Executing pure D at compile-time

Andrei Alexandrescu (See Website For Email) SeeWebsiteForEmail at erdani.org
Thu Feb 8 09:05:37 PST 2007


kris wrote:
> Following on from the "Regex Redux thread, it seems to me there's an 
> easy way to execute pure D at compile-time. A few elements are needed:
> 
> 1) the ability to describe a compile-time function call
> 2) the facility to pass arguments to it, and recieve a return value
> 3) a means of identifiying the D code to execute
> 4) a manner in which the pure D is executed
> 5) a mechanism for ensuring the executed code is docile

6) Ensuring that the code executing at compile-time has full access to 
program's symbols.

1-5 define a way to define dual functions in D, which is a good thing. 
But without (6), they are useless.


Andrei



More information about the Digitalmars-d mailing list