News for hackers. Stuff that matters.
Re:How recursion got into Algol 60: a comedy of errors by bbcbasic on Thursday August 27, 2015 @10:56PM (#10133516)
Hmm. How is this recursion?

Maybe I don't understand what the word recursion means, but I thought that you'd have to call yourself directly or indirectly.

Re:How recursion got into Algol 60: a comedy of errors by LesZedCB on Thursday August 27, 2015 @11:23PM (#10133587)
It's not recursion in the sense that it calls itself. However, it does divide the problem into smaller (though explicitly defined) chunks, which is still recursion.

You could state it that the multiple by a power of two is the sum of the multiples of one order of magnitude base 2 lower.

Re:How recursion got into Algol 60: a comedy of errors by ScottBurson on Friday August 28, 2015 @12:04AM (#10133683)
You're right. This isn't recursion by any definition I know. Cute, though.
Re:How recursion got into Algol 60: a comedy of errors by bbcbasic on Friday August 28, 2015 @05:10AM (#10134401)
Yes from the answers it seems it is recursion, as long as you stretch the definition of recursion to mean making subroutine calls, or code that can be refactored into a recursive solution.

By these definitions, all but the most trivial code is recursive.

Re:How recursion got into Algol 60: a comedy of errors by sgustard on Friday August 28, 2015 @01:24AM (#10133872)
It's equivalent to this recursive function, just change x2(n) to x(n, 2) and so on.

  // e is a power of two
  int mult(x, e)
    return e==1 ? x : mult(x, e/2) + mult(x, e/2)
  end