Software Assurance Reference Dataset

Tobias Müller via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 21 14:35:25 PDT 2014


"Andrew Godfrey" <X at y.com> wrote:
> 1) A function annotation that means "I will call myself
> recursively, and when I do, I expect the tail recursion
> optimization." I have seen code which allocates something big on
> the stack and depends on the optimization. So this intent should
> be expressible.

Wouldn't it be more useful to have a modified/annotated return statement
for that?

Tail-recursiveness is an implementation detail, for the user of the
function it's not really interesting. Except for the fact that it has
bounded stack size which is a useful property by itself and not only for
tailrecursive functions.

Tobi


More information about the Digitalmars-d mailing list