Compile time function execution...

Russell Lewis webmaster at villagersonline.com
Thu Feb 15 16:52:38 PST 2007


Michiel wrote:
> BCS wrote:
> 
>> 6) when the whole program is const foldable, e.i. no runtime inputs,
>> like with some scientific software.
> 
> That's interesting. What kind of program has no runtime inputs?
> 
> And why would it be a problem if the whole program is reduced to
> printing constants to the output? It would certainly be small and fast.

How about:

import std.stdio;
void main() {
   writefln("%d\n", CalculateTheAnswerToLifeUniverseEverything());
}

if it took 7.5 million years to run on a supercomputer, how long is it 
going to take to run on your compiler?



More information about the Digitalmars-d mailing list