News for hackers. Stuff that matters.
Re:It Is What It Is (And Nothing Else) – Why Recursion Still... by chriswarbo on Monday February 22, 2016 @02:31PM (#11153569)
I was under the impression that Schemes generally compile down to continuation-passing-style, and hence in the case of something like Fibonacci one of the recursive calls would be performed as a tail call, whilst the other would become part of the continuation, e.g. something like:

    function fib(n, k) {
      if (n == 0) k(1);
      if (n == 1) k(1);
      fib(n-1, function(f_1) {
                 fib(n-2, function(f_2) {
                            k(f_1 + f_2);
                          });
               });
    }

There are no comments on this comment yet.