[plt-scheme] abstract wall of recursion

From: Carl Eastlund (carl.eastlund at gmail.com)
Date: Sun Nov 22 17:44:29 EST 2009

On Sun, Nov 22, 2009 at 3:54 PM, mike <anesward at mac.com> wrote:
> Problem 14.3.4 and 15.1.2 were certainly challenging but i was able to
> solve them by not thinking too deeply about the
> recursive procedures embedded within both solutions. And
> that is the problem if i try to think too much about what is
> going on, i feel i'm hitting an abstract wall made of steel.
>  I hope this unsettled feeling is part of the learning process
> and will pass.
> mike

Actually, I would say you're on the right side of that wall.  That
wall is part of the lesson.  It is the computer's job to think deeply
about the recursion, taking 1,000 steps to process a list of 1,000
elements.  It is the programmer's job to think shallowly about
recursion.  To process a list of 1,000 elements, you only have to
think about two steps: 0 elements (the base or "empty?" case) and "one
more" element (the recursive or "cons?" case).  When writing the "one
more" case, you don't have to think about the 999 steps the recursive
call takes, you get to trust that they work and use your contract,
purpose statement, and examples to figure out what they (should) do.

--Carl


Posted on the users mailing list.