Compile time function execution...
Bill Baxter
dnewsgroup at billbaxter.com
Thu Feb 15 13:12:14 PST 2007
Walter Bright wrote:
> ... is now in DMD 1.006. For example:
>
Very nice!
A few questions:
1) You say recursion is allowed -- does it do proper tail recursion?
2) Can't you just ignore 'synchronized' at compile time?
3) Would it be possible to add some sort of a version(CompileTime)?
This would make it possible for those who want to be *sure* the function
is only used at compile time to simply have it not exist as a runtime
call. It could also be used to make slight modifications to functions
that one would like to use as both compile-time and run-time. For
example if you want to have synchronized/try/catch/throw/writefln type
things in the runtime version.
--bb
More information about the Digitalmars-d
mailing list