How about a 100% CTFE?

deadalnix deadalnix at gmail.com
Tue Nov 8 04:56:21 PST 2011


Le 07/11/2011 17:00, Gor Gyolchanyan a écrit :
>> Well and somefunction ? It does modify teh value of a too. Is it executed before ? after ? What is the value at the end of all that ?
>
> Obviously it will be incremented first.
> The order is dependent of the rules by which the conditions are
> evaluated at compile-time. For example, the compiler will build a
> depth-first list of the import tree and evaluate code sequentially in
> each module. As i already said, it works just like at run-time.
> Is it so hard to imagine taking the compile-time code, run it during
> compilation separately with the exact same rules as it would during
> compilation?
>

Well except that module can modify a and not be in the tree.

>> Well, if you don't see any problem, you should probably just stop trying to provide a solution.
>
> Ok, this is just ridiculous. Are you serious about this question or
> are you trolling to say the least? In either way, I don't see any
> problem in _having mutable compile-time values_.
>

I'm not trolling, I'm dead serious ! If you have hard time to figure out 
what the problems are, it is unlikely that you come up with a satisfying 
solution, except by being lucky.


More information about the Digitalmars-d mailing list