Executing pure D at compile-time

Carlos Santander csantander619 at gmail.com
Mon Feb 12 14:55:47 PST 2007


kris escribió:
> Andrei Alexandrescu (See Website For Email) wrote:
>> 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.
> 
> On the contrary, they have access to the arguments passed to them; and 
> to thoose arguments only.
> 
> 

Sorry, I'm just catching up.
How would your regex example work if it can only access the arguments? It 
wouldn't be able to do "new RegExp".

-- 
Carlos Santander Bernal



More information about the Digitalmars-d mailing list