November 13, 2012 Extent of tail call optimization in D? | ||||
|---|---|---|---|---|
| ||||
In Dr Alexandrescu's "The D Programming Language", on page 12, it is noted that the D compiler will rewrite tail calls within a procedure as loops. Does the compiler rewrite tail calls between procedures as jumps?
For example, in pseudo-D:
void foo(K)(K cont, stuff..) {
// Do things with stuff.
cont(things);
}
Is the call `cont(things)' optimized?
| ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply