DIP: Tail call optimization
Dietrich Daroch via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Sat Jul 9 23:44:22 PDT 2016
On Sunday, 10 July 2016 at 06:17:08 UTC, ketmar wrote:
> On Sunday, 10 July 2016 at 05:55:50 UTC, Dietrich Daroch wrote:
>> Yes, it probably does TCO. The problem is what if you think it
>> does and it cannot do it because of a misunderstanding on when
>> it can be applied or a bug?
>
> there can't be any "misunderstanding" from compiler side.
> either it is a leaf return, or not -- it is as easy as that.
> what your DIP is aimed for is brain-damaged coders who are not
> able to understand how programs work (and why "scope(exit)" may
> prevent TCO). it won't help anyone. sorry.
Yes, there is no cure for poor skills, but the point is to
prevent the need to avoid recursion to ensure there are no stack
overflows. It seems reasonable considering D targets systems
programming.
More information about the Digitalmars-d-announce
mailing list