News for hackers. Stuff that matters.
Re:Crafting Interpreters: Classes by JoelJacobson on Tuesday October 31, 2017 @03:29PM (#15595856)
Trying to get Donald Knuth's Man or Boy test to run, but it dies with "Stack overflow.".

Any ideas on how to make it run?

fun A (k, x1, x2, x3, x4, x5) { print k; fun B() { k = k - 1; return A(k, B, x1, x2, x3, x4); } if (k <= 0) { return x4() + x5(); } else { return B(); } }

fun F(i) { fun G() { return i; } return G; }

print A(10, F(1), F(-1), F(-1), F(1), F(0)); // expect: -67

There are no comments on this comment yet.