On Monday, 11 July 2016 at 10:25:36 UTC, Tofu Ninja wrote:
On Sunday, 10 July 2016 at 13:15:38 UTC, Andrew Godfrey wrote:
Btw here's a thread from 2014 that touches on the idea of a "tailrec" annotation. At the time, Walter viewed the optimization as the compiler's business and not something he'd elevate to a language feature:


http://forum.dlang.org/post/lqp6pu$1kkv$1...@digitalmars.com

I find it odd that something like tail recursions that actually makes certain things possible that wouldn't be otherwise is seen as only an optimization, when things like inlining which really is only an optimization is seen as important enough to have a pragma.

I agree. Maybe Walter has reconsidered since then. He did also say, though, that he thinks D supports enough different programming styles already.

Would you be satisfied with a pragma? I'd intuited (but could be wrong) that the focus of your proposal was to get a compiler error if someone makes a change to a recursive function, that causes the compiler to be unable to apply the TCO optimization. If that is your focus, it has heavy implications and the feature can't just be a pragma.


              • ... ketmar via Digitalmars-d-announce
              • ... ag0aep6g via Digitalmars-d-announce
              • ... ketmar via Digitalmars-d-announce
              • ... ag0aep6g via Digitalmars-d-announce
              • ... ketmar via Digitalmars-d-announce
              • ... ag0aep6g via Digitalmars-d-announce
              • ... ketmar via Digitalmars-d-announce
  • Re: DIP: Tail call optimiz... Andrew Godfrey via Digitalmars-d-announce
    • Re: DIP: Tail call op... Andrew Godfrey via Digitalmars-d-announce
      • Re: DIP: Tail cal... Tofu Ninja via Digitalmars-d-announce
        • Re: DIP: Tail... Andrew Godfrey via Digitalmars-d-announce
          • Re: DIP: ... Dietrich Daroch via Digitalmars-d-announce
            • Re: ... Ola Fosheim Grøstad via Digitalmars-d-announce
              • ... Dietrich Daroch via Digitalmars-d-announce
              • ... Ola Fosheim Grøstad via Digitalmars-d-announce
            • Re: ... Andrew Godfrey via Digitalmars-d-announce
              • ... Dietrich Daroch via Digitalmars-d-announce
              • ... Andrew Godfrey via Digitalmars-d-announce
              • ... Dietrich Daroch via Digitalmars-d-announce
    • Re: DIP: Tail call op... Dietrich Daroch via Digitalmars-d-announce
  • Re: DIP: Tail call optimiz... Ola Fosheim Grøstad via Digitalmars-d-announce

Reply via email to