On Monday, 2 January 2017 at 19:01:43 UTC, Stefan Koch wrote:
On Monday, 2 January 2017 at 18:40:44 UTC, Stefan Koch wrote:
So guys.
basic function-calls are supported.
Hell YEAH!
Meaning this will compile :
uint caller(uint n)
{
return callee(n, 2);
}
uint callee(uint a, uint b)
{
return a*b;
}
static assert(caller(3) == 6);
static assert(caller(24) == 48);
uint rfn(uint n)
{
if (n) return n + rfn(n-1);
return 1;
}
pragma(msg, rfn(2000));
There's something I've been wondering about. NewCTFE is basically
just another backend, right? Does this mean that you'll have to
implement various optimizations such as tail-call elision
independently from what DMD with the default backend currently
does?