I've been pondering over this idea for a few weeks. What about
functions/methods that are built and ran at compile time.
Admittedly this sounds a bit like pre-processing, but it's not.
I like the idea too... since it would help make metaprogramming
easier by allowing to do some things using function syntax...
compile int matrix_size(int a, int b) { return a * b; }
double [matrix_size(4, 5)] my_array;
What I'm not sure it weither we should allows arbitrary code
in those functions or if we should only allows constant expression
evaluation (this might include math function like sin).
const double sin30 = sin(deg2rad(30));
I would think that a compile time function would need to have
a return value that is a constant (or maybe a global object).
The function must be evaluable at compile-time and have no
side-effect...
Here we see that we would like to have functions that can be
both compile-time or run-time... Will this cause a debate like
we have seen in C++ on the utility of inline... Would we need
another modifier to say either compile or run-time (we were
having a similar question for static vs run-time assert)?